Building a cross to arm-netbsdelf1.6.1 with mainline (20030821) fails configuring libstdc++: checking for arm-netbsdelf1.6.1-gcc... (cached) /tmp/mainline/objdir/gcc/xgcc -B/tmp/ mainline/objdir/gcc/ -B/tmp/dara//arm-netbsdelf1.6.1/bin/ -B/tmp/dara//arm-netbsdelf1.6.1/ lib/ -isystem /tmp/dara//arm-netbsdelf1.6.1/include -isystem /tmp/dara//arm-netbsdelf1.6.1/ sys-include checking for C compiler default output... configure: error: C compiler cannot create executables ... the error in config.log is as follows: configure:2349: checking for C compiler default output configure:2352: /tmp/mainline/objdir/gcc/xgcc -B/tmp/mainline/objdir/gcc/ -B/tmp/dara// arm-netbsdelf1.6.1/bin/ -B/tmp/dara//arm-netbsdelf1.6.1/lib/ -isystem /tmp/dara//arm- netbsdelf1.6.1/include -isystem /tmp/dara//arm-netbsdelf1.6.1/sys-include -O2 -g -O2 -O2 -g -O2 conftest.c >&5 /tmp/dara//arm-netbsdelf1.6.1/bin/ld: a.out: hidden symbol `__fixunsdfsi' in /tmp/mainline/ objdir/gcc/libgcc.a(_fixunsdfsi.oS) is referenced by DSO collect2: ld returned 1 exit status Compiler configured with: ../gcc/configure --enable-languages=c,c++,objc --prefix=/tmp/dara/ --target=arm-netbsdelf1.6.1 --with-sysroot=/tmp/dara/arm-netbsdelf1.6.1/sysroot/
Here's the full compile line that fails (for any simple C testcase): bash-2.04$ gcc/xgcc -B gcc/ foo.c /tmp/dara//lib/../arm-netbsdelf1.6.1/bin/ld: a.out: hidden symbol `__fixunsdfsi' in gcc/ libgcc.a(_fixunsdfsi.oS) is referenced by DSO collect2: ld returned 1 exit status bash-2.04$ gcc/xgcc-v -B gcc/ foo.c bash: gcc/xgcc-v: No such file or directory bash-2.04$ gcc/xgcc -v -B gcc/ foo.c Reading specs from gcc/specs Configured with: '../gcc/configure' '--enable-languages=c,c++,objc '--prefix=/tmp/dara/ '-- target=arm-netbsdelf1.6.1 '--with-sysroot=/tmp/dara/arm-netbsdelf1.6.1/sysroot/ Thread model: single gcc version 3.4 20030821 (experimental) gcc/cc1 -quiet -v -iprefix /tmp/mainline/objdir/gcc/../lib/gcc/arm-netbsdelf1.6.1/3.4/ - isystem gcc/include -D__ARM_ARCH_3__ foo.c -quiet -dumpbase foo.c -auxbase foo -version -o /tmp/ccXp21Jl.s ignoring nonexistent directory "/tmp/mainline/objdir/gcc/../lib/gcc/arm-netbsdelf1.6.1/3.4/ include" ignoring nonexistent directory "/tmp/mainline/objdir/gcc/../lib/gcc/arm-netbsdelf1.6.1/3.4/../../ ../../arm-netbsdelf1.6.1/include" ignoring nonexistent directory "/tmp/dara/arm-netbsdelf1.6.1/sysroot//usr/local/include" ignoring nonexistent directory "/tmp/dara//lib/gcc/arm-netbsdelf1.6.1/3.4/include" ignoring nonexistent directory "/tmp/dara//lib/../arm-netbsdelf1.6.1/include" #include "..." search starts here: #include <...> search starts here: gcc/include /tmp/dara/arm-netbsdelf1.6.1/sysroot//usr/include End of search list. GNU C version 3.4 20030821 (experimental) (arm-netbsdelf1.6.1) compiled by GNU C version 3.2 20020903 (Red Hat Linux 8.0 3.2-7). GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=31884 /tmp/dara//lib/../arm-netbsdelf1.6.1/bin/as -mfpu=softvfp -matpcs -o /tmp/ccI2APZx.o /tmp/ ccXp21Jl.s gcc/collect2 -X -dc -dp -e __start -dynamic-linker /usr/libexec/ld.elf_so /tmp/dara/arm- netbsdelf1.6.1/sysroot//usr/lib/crt0.o /tmp/dara/arm-netbsdelf1.6.1/sysroot//usr/lib/crtbegin.o -Lgcc -L/tmp/dara//lib/../arm-netbsdelf1.6.1/lib -L/tmp/dara//lib -L/tmp/dara/arm- netbsdelf1.6.1/sysroot//usr/lib /tmp/ccI2APZx.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /tmp/dara/ arm-netbsdelf1.6.1/sysroot//usr/lib/crtend.o /tmp/dara//lib/../arm-netbsdelf1.6.1/bin/ld: a.out: hidden symbol `__fixunsdfsi' in gcc/ libgcc.a(_fixunsdfsi.oS) is referenced by DSO collect2: ld returned 1 exit status
looks like related to the patch which Dan sumbitted for sh4 <http://gcc.gnu.org/ml/gcc-patches/ 2003-08/msg01255.html> but I think the problem is these symbols are most definitely in libgcc- std.ver, maybe it is not being used. Can you provide the link command for libgcc_s.so?
You mean this one? mv 'libgcc/./tmp-libgcc.map' libgcc/./libgcc.map /tmp/mainline/objdir/gcc/xgcc -B/tmp/mainline/objdir/gcc/ -B/tmp/dara//arm-netbsdelf1.6.1/ bin/ -B/tmp/dara//arm-netbsdelf1.6.1/lib/ -isystem /tmp/dara//arm-netbsdelf1.6.1/include - isystem /tmp/dara//arm-netbsdelf1.6.1/sys-include -O2 -DIN_GCC -DCROSS_COMPILE -W - Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include -fomit- frame-pointer -fpic -g0 -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -shared -nodefaultlibs - Wl,-soname,libgcc_s.so.1 -o libgcc_s.so libgcc/./_muldi3.o libgcc/./_negdi2.o libgcc/./_lshrdi3.o libgcc/./_ashldi3.o libgcc/./_ashrdi3.o libgcc/./_cmpdi2.o libgcc/./_ucmpdi2.o libgcc/./ _floatdidf.o libgcc/./_floatdisf.o libgcc/./_fixunsdfsi.o libgcc/./_fixunssfsi.o libgcc/./_fixunsdfdi.o libgcc/./_fixdfdi.o libgcc/./_fixunssfdi.o libgcc/./_fixsfdi.o libgcc/./_fixxfdi.o libgcc/./ _fixunsxfdi.o libgcc/./_floatdixf.o libgcc/./_fixunsxfsi.o libgcc/./_fixtfdi.o libgcc/./_fixunstfdi.o libgcc/./_floatditf.o libgcc/./_clear_cache.o libgcc/./_trampoline.o libgcc/./__main.o libgcc/./ _absvsi2.o libgcc/./_absvdi2.o libgcc/./_addvsi3.o libgcc/./_addvdi3.o libgcc/./_subvsi3.o libgcc/ ./_subvdi3.o libgcc/./_mulvsi3.o libgcc/./_mulvdi3.o libgcc/./_negvsi2.o libgcc/./_negvdi2.o libgcc/./_ctors.o libgcc/./_ffssi2.o libgcc/./_ffsdi2.o libgcc/./_clz.o libgcc/./_clzsi2.o libgcc/./ _clzdi2.o libgcc/./_ctzsi2.o libgcc/./_ctzdi2.o libgcc/./_popcount_tab.o libgcc/./_popcountsi2.o libgcc/./_popcountdi2.o libgcc/./_paritysi2.o libgcc/./_paritydi2.o libgcc/./_divdi3.o libgcc/./ _moddi3.o libgcc/./_udivdi3.o libgcc/./_umoddi3.o libgcc/./_udiv_w_sdiv.o libgcc/./ _udivmoddi4.o libgcc/./unwind-dw2.o libgcc/./unwind-dw2-fde.o libgcc/./unwind-sjlj.o libgcc/ ./gthr-gnat.o libgcc/./unwind-c.o -lc && rm -f libgcc_s.so.1 && ln -s libgcc_s.so libgcc_s.so.1
Looks like ld is not using the map which it should be using by '-Wl,--version-script=libgcc/./ libgcc.map'
Sorry to keep bugging you about netbsd gcc stuff, but do you have any suggestions for this problem? Thanks.
I've seen this myself if I try to use a recent version of GNU ld. The problem is that ld now implements the .hidden binding on symbols correctly and won't allow a DSO to reference a hidden symbol in the main application (previously it would quietly allow this). Since libc on arm-netbsd systems does not contain its own definition of __fixunsdfsi the link fails with the error you are seeing. I have a patch to NetBSD-current in my own source tree that fixes this problem (by adding __fixunsdfsi and a few other similar cases to libc.so), but I haven't fed it back into the netbsd source tree yet, and it probably doesn't apply to the 1.6 release since the compiler and support libraries have all changed since then. Your best bet is to make sure you use the system linker rather than the GNU one for now. You can also peruse a discussion on this issue on the tech-toolchain mailing list back in Nov 2003 (subject "softfloat fixuns woes"). Can you confirm my suspicions about your version of ld? If so, I think this is really a NetBSD problem rather than a GCC one.
The toolchain was in fact using GNU binutils 2.14. Sounds like this can probably be closed. Though a note stating what you mentioned below in the docs. wouldn't hurt.
Indeed, if libc doesn't have all the symbols that it should, it's a netbsd bug.