Solaris 7 build fails for current cvs resolved, but static/dyn. libproblems

Bruno.Voigt@ic3s.de Bruno.Voigt@ic3s.de
Sat Apr 1 00:00:00 GMT 2000


Hi Stephen,

great - hint #1 worked instantly!
I will try the other way also..

Thanks a lot,
Bruno
--
Bruno.Voigt@ic3s.de  # IC3S AG # Tel. +49.4106.655.105 # Fax. +49.4106.4618
http://www.ic3s.de   # Mobile +49.700.686.00.686

Ya, I had the exact same problem under Solaris 6.  It seems that the
libstdc++
libraries have made assumptions about the order of static constructors
which
are dependant on the tools used (ie. non-portable assumptions).  While I
couldn't figure out how to remedy the assumptions, I did come up with two
solutions that worked.

(1) You can't use -static because the nsl library requires dynamic linking
only.  What you can do is link the libstdc++.a library explicitly, ie.

           LIBS=/usr/local/lib/libstdc++.a -lsocket -lnsl

This worked, but resulted in larger binary files because of the static
linking.

(2) Obtain and install the GNU binutils and rebuild gcc with --with-gnu-ld.

Make sure the GNU ld is in your path when you link.  It seems the static
constructors are instantiated in the correct dependency order when I build
with
the GNU linker instead of the native Solaris one.

Stephen M. Webb





More information about the Libstdc++ mailing list