tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Missing __fixsfsi from libgcc.a



On Wed, 13 Jun 2012 16:28:35 +0200
Martin Husemann <martin%duskware.de@localhost> wrote:

> On Wed, Jun 13, 2012 at 05:12:09PM +0300, Petri Laakso wrote:
> > But when it comes time to link object files, I get:
> > test_prep.c:(.text+0x1c): undefined reference to `__fixsfsi'
> 
> How do you link it? The easiest way is to use gcc and let it deal with
> all the required magic (like getting the proper elf note in).

I just added some floating point C code to 
src/sys/arch/evbarm/stand/boot2440/main.c
to make compile fail. As it seems, C compiler generates call to floating point
functions when it hits floating point operations. But linker fails to find
code which implement these calls. Should this even work? I'd excepted compiler
to generate software FP code because CPU doesn't implement HW FP..

Here is small change which demostrates what I am talking about:

--- main.c.orig 2012-06-13 19:32:14.507474759 +0300
+++ main.c      2012-06-13 19:29:28.975887327 +0300
@@ -108,6 +108,7 @@ main(int argc, char *argv[])
 {
        int fclk, hclk;
        int fd;
+       float fd2;
        unsigned long marks[MARK_MAX];
        unsigned char hdr[0x26];
        void (*entry)(void*);
@@ -117,6 +118,10 @@ main(int argc, char *argv[])
        bool kernel_loaded;
        uint8_t enaddr[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
+       fd2 = 3.3 / 3.3;
+       fd2++;
+       fd = fd2;
+
        /* Give some indication that main() has been reached */
        CLEAR_LEDS();
        LED_ON(4);

And the error from: src/sys/arch/evbarm/stand/boot2440$ MAKEVERBOSE=3 
nbmake-evbarm-e

#   compile  boot2440/vers.o
/work/nb6/tooldir/bin/arm--netbsdelf-gcc  -Wall -Wno-main -ffreestanding 
-march=armv4  -std=gnu99 -Werror    --sysroot=/work/nb6/destdir -D_STANDALONE 
-DSUPPORT_DHCP -DDM9000MAC="0x08,0x08,0x11,0x18,0x12,0x27" 
-DDEFAULT_BOOTFILE="ld0a:netbsd;net:" -nostdinc -I. 
-I/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440 
-I/work/nb6/obj/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440
 
-I/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440/../../../..
 
-I/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440/../../../../arch
 
-I/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440/../../../../lib/libkern/../../../common/lib/libc/quad
 
-I/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440/../../../../lib/libkern/../../../common/lib/libc/string
 
-I/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440/../../../../lib/libkern/../../../common/lib/libc/arch/arm/string
  -c    vers.c
/work/nb6/tooldir/bin/arm--netbsdelf-ld -N -Ttext 0x30A00000 -Bstatic -e _start 
-o bootmini2440.elf  entry.o main.o devopen.o netif.o dev_net.o dm9k.o 
dev_sdmmc.o s3csdi.o vers.o 
/work/nb6/obj/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440/lib/sa/libsa.a
 
/work/nb6/obj/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440/lib/z/libz.a
 
/work/nb6/obj/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440/lib/kern/libkern.a
main.o: In function `main':
main.c:(.text+0x58): undefined reference to `__addsf3'
main.c:(.text+0x68): undefined reference to `__fixsfsi'

*** Failed target:  bootmini2440
*** Failed command: /work/nb6/tooldir/bin/arm--netbsdelf-ld -N -Ttext 
0x30A00000 -Bstatic -e _start -o bootmini2440.elf entry.o main.o devopen.o 
netif.o dev_net.o dm9k.o dev_sdmmc.o s3csdi.o vers.o 
/work/nb6/obj/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440/lib/sa/libsa.a
 
/work/nb6/obj/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440/lib/z/libz.a
 
/work/nb6/obj/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440/lib/kern/libkern.a
*** Error code 1

Stop.
nbmake: stopped in 
/home/petri/dev/OLinuXino/NetBSD/src/sys/arch/evbarm/stand/boot2440


Home | Main Index | Thread Index | Old Index