Bug 12015 - [arm-netbsdelf] hidden symbol __fixunsdfsi referenced by DSO
Summary: [arm-netbsdelf] hidden symbol __fixunsdfsi referenced by DSO
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build, documentation
Depends on:
Blocks:
 
Reported: 2003-08-21 18:15 UTC by Dara Hazeghi
Modified: 2004-12-29 00:25 UTC (History)
3 users (show)

See Also:
Host:
Target: arm-netbsdelf1.6.1
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-02-06 01:42:39


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dara Hazeghi 2003-08-21 18:15:57 UTC
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/
Comment 1 Dara Hazeghi 2003-08-21 18:19:04 UTC
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
Comment 2 Andrew Pinski 2003-08-21 18:31:41 UTC
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?
Comment 3 Dara Hazeghi 2003-08-21 19:57:11 UTC
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
Comment 4 Andrew Pinski 2003-08-21 20:00:35 UTC
Looks like ld is not using the map which it should be using by '-Wl,--version-script=libgcc/./
libgcc.map'
Comment 5 Dara Hazeghi 2003-08-24 17:40:30 UTC
Sorry to keep bugging you about netbsd gcc stuff, but do you have any suggestions for this 
problem? Thanks.
Comment 6 Richard Earnshaw 2004-01-14 18:51:42 UTC
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.
Comment 7 Dara Hazeghi 2004-01-16 03:59:21 UTC
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.
Comment 8 Richard Henderson 2004-12-29 00:25:27 UTC
Indeed, if libc doesn't have all the symbols that it should, it's a netbsd bug.