tech-toolchain archive

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

Re: sun2 vs. gcc48



On Mon, Feb 02, 2015 at 01:42:29PM +0100, Joerg Sonnenberger wrote:
> On Sun, Feb 01, 2015 at 08:26:49PM -0800, Chuck Silvers wrote:
> > On Mon, Feb 02, 2015 at 12:19:56AM +0100, Joerg Sonnenberger wrote:
> > > On Sun, Feb 01, 2015 at 02:02:58PM -0800, Chuck Silvers wrote:
> > > > I'm pretty sure that's not correct but I don't know what would be better.
> > > > without that change I get this error trying to link libc.so:
> > > > 
> > > > /home/chs/netbsd/trees/sun2-shlib/destdir/sun2/usr/lib/libgcc.a(_float.o): In function `__negsf2':
> > > > (.text+0x686): multiple definition of `__negsf2'
> > > > libc_pic.a(negsf2.pico):(.text+0x0): first defined here
> > > > /home/chs/netbsd/trees/sun2-shlib/destdir/sun2/usr/lib/libgcc.a(_double.o): In function `__negdf2':
> > > > (.text+0x8ce): multiple definition of `__negdf2'
> > > > libc_pic.a(negdf2.pico):(.text+0x0): first defined here
> > > > collect2: error: ld returned 1 exit status
> > > > *** [libc.so.12.197] Error code 1
> > > 
> > > Can you check the spec, please? libc.so should need nothing from
> > > libgcc.a that libgcc_s.so doesn't already provide.
> > 
> > my understanding of that error is that linking libc.so pulled in __neg* from compiler_rt first,
> > then it pulled in something else from the libgcc _float.o and _double.o, which both define
> > multiple symbols.  it's the subsequent need to pull in _float.o and _double.o for the other symbols
> > that caused the conflict with negsf2.pico and negdf2.pico.
> > 
> > if you still want more information, could you explain what you mean by "check the spec"?
> 
> What is missing in libc is a somewhat separate question. It should still
> only look at libgcc_s.so and not use the content from libgcc.a.
> What does gcc -v for the link show?

$ /home/chs/netbsd/trees/sun2-shlib/tooldir/bin/m68010--netbsdelf-gcc -nodefaultlibs -Wl,-x -shared -Wl,-soname,libc.so.12 -Wl,--warn-shared-textrel -Wl,-Map=libc.so.12.map -Wl,-z,initfirst --sysroot=/home/chs/netbsd/trees/sun2-shlib/destdir/sun2 -o libc.so.12.197 -Wl,-rpath,/lib -L=/lib -Wl,--whole-archive libc_pic.a -Wl,--no-whole-archive -lgcc -v
Using built-in specs.
COLLECT_GCC=/home/chs/netbsd/trees/sun2-shlib/tooldir/bin/m68010--netbsdelf-gcc
COLLECT_LTO_WRAPPER=/home/chs/netbsd/trees/sun2-shlib/tooldir/libexec/gcc/m68010--netbsdelf/4.8.4/lto-wrapper
Target: m68010--netbsdelf
Configured with: /home/chs/netbsd/trees/sun2-shlib/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=m68010--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --enable-libstdcxx-time=rt --enable-lto --with-sysroot=/home/chs/netbsd/trees/sun2-shlib/destdir/sun2 --with-mpc=/home/chs/netbsd/trees/sun2-shlib/tooldir --with-mpfr=/home/chs/netbsd/trees/sun2-shlib/tooldir --with-gmp=/home/chs/netbsd/trees/sun2-shlib/tooldir --disable-nls --disable-multilib --program-transform-name=s,^,m68010--netbsdelf-, --enable-languages='c c++ objc' --prefix=/home/chs/netbsd/trees/sun2-shlib/tooldir
Thread model: posix
gcc version 4.8.4 (NetBSD nb2 20150115) 
COMPILER_PATH=/home/chs/netbsd/trees/sun2-shlib/tooldir/libexec/gcc/m68010--netbsdelf/4.8.4/:/home/chs/netbsd/trees/sun2-shlib/tooldir/libexec/gcc/m68010--netbsdelf/4.8.4/:/home/chs/netbsd/trees/sun2-shlib/tooldir/libexec/gcc/m68010--netbsdelf/:/home/chs/netbsd/trees/sun2-shlib/tooldir/lib/gcc/m68010--netbsdelf/4.8.4/:/home/chs/netbsd/trees/sun2-shlib/tooldir/lib/gcc/m68010--netbsdelf/:/home/chs/netbsd/trees/sun2-shlib/tooldir/lib/gcc/m68010--netbsdelf/4.8.4/../../../../m68010--netbsdelf/bin/
LIBRARY_PATH=/home/chs/netbsd/trees/sun2-shlib/tooldir/lib/gcc/m68010--netbsdelf/4.8.4/:/home/chs/netbsd/trees/sun2-shlib/tooldir/lib/gcc/m68010--netbsdelf/4.8.4/../../../../m68010--netbsdelf/lib/:/home/chs/netbsd/trees/sun2-shlib/destdir/sun2/usr/lib/
COLLECT_GCC_OPTIONS='-nodefaultlibs' '-shared' '-o' 'libc.so.12.197' '-L=/lib' '-v'
 /home/chs/netbsd/trees/sun2-shlib/tooldir/libexec/gcc/m68010--netbsdelf/4.8.4/collect2 --sysroot=/home/chs/netbsd/trees/sun2-shlib/destdir/sun2 --eh-frame-hdr -shared -o libc.so.12.197 /home/chs/netbsd/trees/sun2-shlib/destdir/sun2/usr/lib/crti.o /home/chs/netbsd/trees/sun2-shlib/destdir/sun2/usr/lib/crtbeginS.o -L=/lib -L/home/chs/netbsd/trees/sun2-shlib/tooldir/lib/gcc/m68010--netbsdelf/4.8.4 -L/home/chs/netbsd/trees/sun2-shlib/tooldir/lib/gcc/m68010--netbsdelf/4.8.4/../../../../m68010--netbsdelf/lib -L/home/chs/netbsd/trees/sun2-shlib/destdir/sun2/usr/lib -x -soname libc.so.12 --warn-shared-textrel -Map=libc.so.12.map -z initfirst -rpath /lib --whole-archive libc_pic.a --no-whole-archive -lgcc /home/chs/netbsd/trees/sun2-shlib/destdir/sun2/usr/lib/crtendS.o /home/chs/netbsd/trees/sun2-shlib/destdir/sun2/usr/lib/crtn.o
/home/chs/netbsd/trees/sun2-shlib/destdir/sun2/usr/lib/libgcc.a(_float.o): In function `__negsf2':
(.text+0x686): multiple definition of `__negsf2'
libc_pic.a(negsf2.pico):(.text+0x0): first defined here
/home/chs/netbsd/trees/sun2-shlib/destdir/sun2/usr/lib/libgcc.a(_double.o): In function `__negdf2':
(.text+0x8ce): multiple definition of `__negdf2'
libc_pic.a(negdf2.pico):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status



libc.so is not linked against libgcc_s.so.
that's the case on other platforms such as amd64, not just the new sun2.
every other shared library does have a NEEDED entry for libgcc_s.so.1 though,
so I don't know it would help for libc to be special in this regard.

-Chuck


Home | Main Index | Thread Index | Old Index