Skip to contentSkip to conversation

PPC405 float point linker error

U-Boot-Users Nag 2 participants 2 messages Mar 22, 2004

lore
Share & tools
lore

Nag

author
#0 lore raw

Dear All,

When I am trying to use floating point values in hello_world.c (U-Boot/examples), I am getting the following linker errors: ? ( I have copied libgcc.a from /install/lib/gcc-lib/ppc-elf/2.93.3 into Uboot/examples directory and linked hello_world.o with this libgcc.a)
powerpc-elf-ld -g -Ttext 0xF00000 -o hello_world -e hello_world hello_world.o libsyscall.a libgcc.a

powerpc-elf-ld: fp-bit.o: compiled normally and linked with modules compiled with - mrelocatable

Bad value: failed to merge target specific data of file libgcc.a(fp-bit.o)
powerpc-elf-ld: dp-bit.o: compiled normally and linked with modules compiled with - mrelocatable

Bad value: failed to merge target specific data of file libgcc.a(dp-bit.o)
powerpc-elf-ld: _lshrdi3.o: compiled normally and linked with modules compiled with - mrelocatable Bad value: failed to merge target specific data of file libgcc.a(_lshrdi3.o) make[1]: *** [hello_world.srec] Error 1
make[1]: Leaving directory `/usr/nagraj/ppctools/uboot/VT/examples'
make: *** [subdirs] Error 1

And does U-boot supports mon_printf("%f") (floating point values printing) ?

Before this I have compiled hello_world.c with the following command without any errors
powerpc-elf-gcc -g -Os -mrelocatable -ffixed-r14 -meabi -D__KERNEL__ -DTEXT_BASE=0xFFF80000 -I/usr/nagraj/ppctools/uboot/VT/include -fno-builtin -nostdinc -isystem /usr/nagraj/gcc/install/lib/gcc-lib/powerpc-elf/2.95.3/ include -pipe -DCONFIG_PPC -D__powerpc__ -DCONFIG_4xx -ffixed-r2 -ffixed-r29 -mstring -Wa,-m405 -mcpu=405 -msoft-float -Wall -Wstrict-prototypes -c -o hello_world.o hello_world.c

I have configured U-boot for Walnut405 board and it is working fine. Since PowerPC405 doesn't support hardware floting-point I am trying to use soft float routines.

First I have build cross compiler(On X86 RedHat Linux-9.0 Host for PPC405 target) tools with following commands

            $ mkdir build-binutils
            $ mkdir build-gcc
            $ mkdir build-newlib
            $ mkdir install
            $ export TARGET=powerpc-elf
            $ export PREFIX=`pwd`/install
            $ export PATH=$PATH:$PREFIX/bin
            $ set | grep PREFIX
            $ tar xzvf binutils-2.11.2.tar.gz
            $ tar xzvf gcc-2.95.3.tar.gz
            $ tar xzvf newlib-1.9.0.tar.gz
            $ cd build-binutils
            $ ../binutils-2.11.2/configure --target=$TARGET --prefix=$PREFIX
            $ make all install 2>&1 | tee make.log
            $ cd ..
            $ cd build-gcc
            $ ../gcc-2.95.3/configure --target=$TARGET --prefix=$PREFIX \ --nfp
               --with-newlib --without-headers --with-gnu-as \
               --with-gnu-ld --disable-shared --enable-languages=c
            $ make all-gcc install-gcc 2>&1 | tee make.log
            $ cd ..
            $ cd build-newlib
            $ ../newlib-1.9.0/configure --target=$TARGET --prefix=$PREFIX
            $ make all install 2>&1 | tee make.log
            $ cd ..
            $ cd build-gcc && rm -rf *
            $ ../gcc-2.95.3/configure --target=$TARGET --prefix=$PREFIX \ --nfp
               --with-gnu-as --with-gnu-ld --enable-languages=c
            $ make all install 2>&1 | tee make.log
            $ cd ..      

Any help would be appreciated. And advanced thanks.

With Best Regards,

Nag

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20040322/96a484db/attachment.htm

#1 lore raw
Quoted 2 lines · In message <[email protected]> you wrote:

When I am trying to use floating point values in hello_world.c (U-Boot/examples), I am getting the following linker errors: ? ( I have copied libgcc.a from /install/lib/gcc-lib/ppc-elf/2.93.3 into Uboot/examples directory and linked hello_world.o

Please use shorter lines. Some 70 characters or so as recommended in the Netiquette.

In general, U-Boot does not use and does not support floating point.

Quoted 1 line

And does U-boot supports mon_printf("%f") (floating point values printing) ?

There is no FP support in U-Boot.

Quoted 4 lines

--0-1771975882-1079960990=:39202
Content-Type: text/html; charset=us-ascii

<DIV>

And never ever post HTML to this list!!

Best regards,

Wolfgang Denk

Signature · 4 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
How long does it take a  DEC  field  service  engineer  to  change  a
lightbulb?       It depends on how many bad ones he brought with him.