[U-Boot] [PATCH v2] makefiles: fixes for building build tools

Stefan Roese sr at denx.de
Thu Dec 3 19:17:06 CET 2009


On Thursday 03 December 2009 18:49:26 Scott Wood wrote:
> > This is on "next" with ELDK 4.2. Scott, do you have any ideas what's
> > going wrong here?
> 
> I don't see that here -- instead, I get this, with or without this patch:
> 
> $ CROSS_COMPILE=powerpc-linux- ./MAKEALL kilauea
> Configuring for kilauea board...
> powerpc-linux-ld: u-boot: section `.text' can't be allocated in segment 0
> powerpc-linux-ld: final link failed: Bad value
> make: *** [u-boot] Error 1
> 
> This is with binutils 2.18.  Do I need to upgrade?
> 
> Git bisect says:
> 4649913ea5f440d756d150a6fdf2fb2e8ecb75fd is the first bad commit
> commit 4649913ea5f440d756d150a6fdf2fb2e8ecb75fd
> Author: Stefan Roese <sr at denx.de>
> Date:   Tue Oct 27 16:11:26 2009 +0100
> 
>      ppc4xx: Add common ppc4xx linker script
> 
>      This linker script can be used by all PPC4xx platforms. It works for
>      PPC405 and PPC440 platforms. Boards which need a board specific linker
>      script can override this default linker script in board/*/config.mk.
> 
>      Signed-off-by: Stefan Roese <sr at denx.de>

Hmmm. I don't see this here. Do you only see this for katmai, or for other
4xx targets as well? kilauea, sequoia?
 
> Can you post a full boot log of your error?  I'm guessing host crc32.o is
> getting linked into target code or vice versa, though I don't see why that
>  would happen only on 4xx.  One should be tools/crc32.o and the other
>  should be lib_generic/crc32.o.

OK, here some more output:

[stefan at stefan-desktop u-boot (next)]$ CROSS_COMPILE=powerpc-linux- make kilauea_config
Configuring for kilauea board...                                                       
[stefan at stefan-desktop u-boot (next)]$ CROSS_COMPILE=powerpc-linux- make
Generating include/autoconf.mk                                          
Generating include/autoconf.mk.dep                                      
for dir in tools examples/standalone examples/api ; do make -C $dir _depend ; done
make[1]: Entering directory `/home/stefan/git/u-boot/u-boot/tools'                
make[1]: Leaving directory `/home/stefan/git/u-boot/u-boot/tools'                 
make[1]: Entering directory `/home/stefan/git/u-boot/u-boot/tools'                
make[1]: Nothing to be done for `_depend'.                                        
make[1]: Leaving directory `/home/stefan/git/u-boot/u-boot/tools'                 
make[1]: Entering directory `/home/stefan/git/u-boot/u-boot/examples/standalone'  
make[1]: Leaving directory `/home/stefan/git/u-boot/u-boot/examples/standalone'   
make[1]: Entering directory `/home/stefan/git/u-boot/u-boot/examples/standalone'  
make[1]: Nothing to be done for `_depend'.                                        
make[1]: Leaving directory `/home/stefan/git/u-boot/u-boot/examples/standalone'   
make[1]: Entering directory `/home/stefan/git/u-boot/u-boot/examples/api'         
make[1]: Nothing to be done for `_depend'.                                        
make[1]: Leaving directory `/home/stefan/git/u-boot/u-boot/examples/api'          
make -C tools all                                                                 
make[1]: Entering directory `/home/stefan/git/u-boot/u-boot/tools'                
powerpc-linux-gcc  -g  -Os   -mrelocatable -fPIC -ffixed-r14 -meabi -D__KERNEL__ -
DTEXT_BASE=0xFFFA0000 -I/home/stefan/git/u-boot/u-boot/include -fno-builtin -
ffreestanding -nostdinc -isystem /opt/eldk-4.2/usr/bin/../lib/gcc/powerpc-
linux/4.2.2/include -pipe  -DCONFIG_PPC -D__powerpc__ -DCONFIG_4xx -ffixed-r2 -mstring -
msoft-float -Wa,-m405 -mcpu=405 -Wall -Wstrict-prototypes -fno-stack-protector   -o 
crc32.o crc32.c -c
powerpc-linux-gcc  -g  -Os   -mrelocatable -fPIC -ffixed-r14 -meabi -D__KERNEL__ -
DTEXT_BASE=0xFFFA0000 -I/home/stefan/git/u-boot/u-boot/include -fno-builtin -
ffreestanding -nostdinc -isystem /opt/eldk-4.2/usr/bin/../lib/gcc/powerpc-
linux/4.2.2/include -pipe  -DCONFIG_PPC -D__powerpc__ -DCONFIG_4xx -ffixed-r2 -mstring -
msoft-float -Wa,-m405 -mcpu=405 -Wall -Wstrict-prototypes -fno-stack-protector   -o 
env_embedded.o env_embedded.c -c
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter /home/stefan/git/u-
boot/u-boot/include -idirafter /home/stefan/git/u-boot/u-boot/include2 -idirafter 
/home/stefan/git/u-boot/u-boot/include -I /home/stefan/git/u-boot/u-boot/libfdt -I 
/home/stefan/git/u-boot/u-boot/tools -DTEXT_BASE=0xFFFA0000 -DUSE_HOSTCC -
D__KERNEL_STRICT_NAMES -pedantic   -o envcrc.o envcrc.c -c
powerpc-linux-gcc  -g  -Os   -mrelocatable -fPIC -ffixed-r14 -meabi -D__KERNEL__ -
DTEXT_BASE=0xFFFA0000 -I/home/stefan/git/u-boot/u-boot/include -fno-builtin -
ffreestanding -nostdinc -isystem /opt/eldk-4.2/usr/bin/../lib/gcc/powerpc-
linux/4.2.2/include -pipe  -DCONFIG_PPC -D__powerpc__ -DCONFIG_4xx -ffixed-r2 -mstring -
msoft-float -Wa,-m405 -mcpu=405 -Wall -Wstrict-prototypes -fno-stack-protector   -o 
sha1.o sha1.c -c
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter /home/stefan/git/u-
boot/u-boot/include -idirafter /home/stefan/git/u-boot/u-boot/include2 -idirafter 
/home/stefan/git/u-boot/u-boot/include -I /home/stefan/git/u-boot/u-boot/libfdt -I 
/home/stefan/git/u-boot/u-boot/tools -DTEXT_BASE=0xFFFA0000 -DUSE_HOSTCC -
D__KERNEL_STRICT_NAMES -pedantic  -o envcrc crc32.o env_embedded.o envcrc.o sha1.o
/usr/bin/ld: crc32.o: Relocations in generic ELF (EM: 20)
/usr/bin/ld: crc32.o: Relocations in generic ELF (EM: 20)
/usr/bin/ld: crc32.o: Relocations in generic ELF (EM: 20)
/usr/bin/ld: crc32.o: Relocations in generic ELF (EM: 20)
/usr/bin/ld: crc32.o: Relocations in generic ELF (EM: 20)
/usr/bin/ld: crc32.o: Relocations in generic ELF (EM: 20)
/usr/bin/ld: crc32.o: Relocations in generic ELF (EM: 20)
crc32.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[1]: *** [envcrc] Error 1
make[1]: Leaving directory `/home/stefan/git/u-boot/u-boot/tools'
make: *** [tools] Error 2
[stefan at stefan-desktop u-boot (next)]$ file tools/crc32.o
tools/crc32.o: ELF 32-bit MSB relocatable, PowerPC or cisco 4500, version 1 (SYSV), not 
stripped

So the complete tools directory is compiled for powerpc!

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de


More information about the U-Boot mailing list