Static linking issue with gcc

Alexandre Martins alexandre.martins at stormshield.eu
Mon Sep 19 08:20:38 UTC 2016


Hi,

I'm currently facing an annoying problem when compiling a STATIC binary with gcc5 on ARM architecture, with FreeBSD 10.3.

The problem is some of the softfloat eabi symbols are coming from two sources:
 - The libc (/usr/lib/libc.a)
 - The libgcc (/usr/local/lib/gcc5/gcc/armv6-portbld-freebsd10.2/5.4.0/libgcc.a)

The firsts duplicated symbols that the linker complain are "__subdf3" , "__adddf3", "__floatsidf", "__extendsfdf2", ...

I don't know how to fix that or, perhaps, use a workaround.

Can you help me ?

Best regards,

-- 
Alexandre Martins


test.c
--------------------------------------
#include <stdio.h>
#include <math.h>

int main(void) {
        float f = 42.42f;
        printf("%f\n", sqrtf(f));
        return 0;
}
--------------------------------------
gcc5 -static -lm -o test test.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2874 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20160919/4efd21c7/attachment.bin>


More information about the freebsd-arm mailing list