Tuesday, December 22, 2009
"make all" gives weird errors that don't make sense
Q: I'm trying to build a BSP under OSE5.4.1 and got this error:
$ make all../../rtose/common_rtose.mk:169: *** multiple target patterns. Stop.make: *** [mods] Error 2
This makes no sense whatsoever. I've already done the required mod to environment.mk.
A: Sometimes there is more than one cause.
For example, the OSE baseline is set up differently starting in OSE5.3.x, and is also matched to a BSP for each release. So you should only use the cygwin shipped with OSE5.3.x for building BSPs intended for OSE5.3.x; If you try to use OSE5.3.x cygwin to build a BSP delivered for use with OSE5.4.x, you may get strange errors. Verify that your cygwin is the correct one and that $OSE_ROOT and toolset is pointing to the right place, e.g.:
$ echo $OSE_ROOT
C:/OSE/OSE5.4.1_PPC
$ which powerpc-eabi-gcc
/cygdrive/c/OSE/OSE5.4.1_PPC/gcc_win32_powerpc_4.2.3/bin/powerpc-eabi-gcc
Another problem may be with corrupted cygwin environment. If you see strange make errors you might quickly check the environment, e.g. run "alias" and see what comes out:
$ alias
'lias gd='grep --directories=recurse
'lias java='E:/ThirdParty/jre1.5.0_06/bin/java.exe
'lias ll='ls -la
Clearly this shows the aliases are not being interpreted correctly, and possibly that the ~/.bash_profile (which has the aliases defined) is corrupted. A quick cleaning with the col utility takes care of this:
$ cp .bash_profile orig.bash_profile
$ col -b < .bash_profile > out.bash_profile
$ cp out.bash_profile .bash_profile
The col utility will remove any escape and other "invisible" chars that may be in the cygwin init files. Not the solution to every strange problem, but something to eliminate and to restart cygwin after fixing.
$ make all../../rtose/common_rtose.mk:169: *** multiple target patterns. Stop.make: *** [mods] Error 2
This makes no sense whatsoever. I've already done the required mod to environment.mk.
A: Sometimes there is more than one cause.
For example, the OSE baseline is set up differently starting in OSE5.3.x, and is also matched to a BSP for each release. So you should only use the cygwin shipped with OSE5.3.x for building BSPs intended for OSE5.3.x; If you try to use OSE5.3.x cygwin to build a BSP delivered for use with OSE5.4.x, you may get strange errors. Verify that your cygwin is the correct one and that $OSE_ROOT and toolset is pointing to the right place, e.g.:
$ echo $OSE_ROOT
C:/OSE/OSE5.4.1_PPC
$ which powerpc-eabi-gcc
/cygdrive/c/OSE/OSE5.4.1_PPC/gcc_win32_powerpc_4.2.3/bin/powerpc-eabi-gcc
Another problem may be with corrupted cygwin environment. If you see strange make errors you might quickly check the environment, e.g. run "alias" and see what comes out:
$ alias
'lias gd='grep --directories=recurse
'lias java='E:/ThirdParty/jre1.5.0_06/bin/java.exe
'lias ll='ls -la
Clearly this shows the aliases are not being interpreted correctly, and possibly that the ~/.bash_profile (which has the aliases defined) is corrupted. A quick cleaning with the col utility takes care of this:
$ cp .bash_profile orig.bash_profile
$ col -b < .bash_profile > out.bash_profile
$ cp out.bash_profile .bash_profile
The col utility will remove any escape and other "invisible" chars that may be in the cygwin init files. Not the solution to every strange problem, but something to eliminate and to restart cygwin after fixing.
Labels: cygwin, make, OSE5, sfk
Friday, December 18, 2009
Compiling load modules for soft kernel?
Q: I want to try a load module in my soft kernel before putting it on the real target. How can I build this? The sfk-win32 ARCH target doesn't work.
A: The trick to getting the LMs to build for sfk is to use ARCH=x86 instead. E.g.:
$ C:/OSE/BSP_SFK_OSE5.4.1/refsys/modules/pingpong
$ make ARCH=x86 all
--- Compiling src/ping.c
--- Compiling src/pong.c
--- Compiling ../../modules/src/libwhat.c for obj/x86/debug/libwhat.o
--- Building lib/x86/debug/libpingpong.a
--- Compiling src/debug_friendly.c
--- Compiling src/pingpong_main.c
--- Concatenating osemain.con fragments
--- Compiling c:/OSE/ose5.4.1_ppc/src/osemain.c
--- Compiling c:/OSE/ose5.4.1_ppc/src/crt0_lm.c
--- Compiling c:/OSE/ose5.4.1_ppc/src/ose_confd.c
--- Linking obj/x86/debug/unconfigured (pass 1)
--- Linking obj/x86/debug/unconfigured (pass 2)
--- Stripping load module from symbol and debug information
--- Postlinking obj/x86/debug/unconfigured
--- Inserting configuration ../../modules/src/default.lmconf
--- Sizing bin/x86/pingpong_debug.elf
Size of text : 29704 (29K) (t)
Size of initdata : 0 (0K) (id)
Size of data : 2084 (2K) (d)
Size of bss : 344 (0K) (b)
ROM footprint : 31788 (31K) (t+d)
RAM footprint : 36864 (36K) (t+id+d+b)
The resulting elf file is located in :
C:/OSE/BSP_SFK_OSE5.4.1/refsys/modules/pingpong/bin/x86/pingpong_debug.elf
This applies for OSE5.4.1 but holds for older releases as well. To upload it, remember that the directory for sfk is mounted locally (for newer OSE5 releases) so you don't need the /tftp/ in the pathname. The default pathname is /host, which represents your root C: level. Just create a temp directory from your C: top-level directory and mount from there, e.g. create C:/oselm, copy the elf file over there, then download it to the rtose for sfk-win32 with:
rtose@softwin> pm_install pingpong /host/oselm/pingpong_debug.elf
rtose@softwin> pm_create pingpong
rtose@softwin> pm_lminfo
core_module
pingpong
A: The trick to getting the LMs to build for sfk is to use ARCH=x86 instead. E.g.:
$ C:/OSE/BSP_SFK_OSE5.4.1/refsys/modules/pingpong
$ make ARCH=x86 all
--- Compiling src/ping.c
--- Compiling src/pong.c
--- Compiling ../../modules/src/libwhat.c for obj/x86/debug/libwhat.o
--- Building lib/x86/debug/libpingpong.a
--- Compiling src/debug_friendly.c
--- Compiling src/pingpong_main.c
--- Concatenating osemain.con fragments
--- Compiling c:/OSE/ose5.4.1_ppc/src/osemain.c
--- Compiling c:/OSE/ose5.4.1_ppc/src/crt0_lm.c
--- Compiling c:/OSE/ose5.4.1_ppc/src/ose_confd.c
--- Linking obj/x86/debug/unconfigured (pass 1)
--- Linking obj/x86/debug/unconfigured (pass 2)
--- Stripping load module from symbol and debug information
--- Postlinking obj/x86/debug/unconfigured
--- Inserting configuration ../../modules/src/default.lmconf
--- Sizing bin/x86/pingpong_debug.elf
Size of text : 29704 (29K) (t)
Size of initdata : 0 (0K) (id)
Size of data : 2084 (2K) (d)
Size of bss : 344 (0K) (b)
ROM footprint : 31788 (31K) (t+d)
RAM footprint : 36864 (36K) (t+id+d+b)
The resulting elf file is located in :
C:/OSE/BSP_SFK_OSE5.4.1/refsys/modules/pingpong/bin/x86/pingpong_debug.elf
This applies for OSE5.4.1 but holds for older releases as well. To upload it, remember that the directory for sfk is mounted locally (for newer OSE5 releases) so you don't need the /tftp/ in the pathname. The default pathname is /host, which represents your root C: level. Just create a temp directory from your C: top-level directory and mount from there, e.g. create C:/oselm, copy the elf file over there, then download it to the rtose for sfk-win32 with:
rtose@softwin> pm_install pingpong /host/oselm/pingpong_debug.elf
rtose@softwin> pm_create pingpong
rtose@softwin> pm_lminfo
core_module
pingpong
Labels: lm, load module, OSE5, sfk
free invisible web counter