V3: Problem on Solaris
Mark Mitchell
mark@codesourcery.com
Sun Nov 12 16:10:00 GMT 2000
>>>>> "Alexandre" == Alexandre Oliva <aoliva@redhat.com> writes:
>> Since libstdc++ assumes that it is being compiled with G++
>> already, it would seem that we could just have used g++
>> -shared, rather than the libtool bits, and maybe someday
>> libstdc++ will be compiled with other compilers.
Alexandre> Unfortunately, it's not that simple. Ask David
Alexandre> Edelsohn, for one :-)
David and I have been trading a lot of messages, but I'm not sure what
you're referring to. (I know the bit about AIX libraries being both
shared/static squished together, but I'm not sure quite what's up.
)It would seem to me that either g++ knows how to build a shared
library on a platform, or it doesn't. Anyhow, I think it's irrelevant
-- we are using libtool...
>> In any case, we are where we are. We could have a new libtool
>> tag for "C++ without stanard libraries".
Alexandre> How about just adding
Alexandre> `-Wl,-nodefaultlibs,-lgcc,-lc,-lgcc' to the command
Alexandre> line that links libstdc++.la? Then, we can use --tag
Alexandre> CXX, as we should.
That sounds plausible. It's not actually abstractly correct, though:
there could be other libraries that we *do* need to link in.
>> I am favoring changing libtool's C configuration to use `gcc
>> -shared' on Solaris
Alexandre> I don't know why libtool doesn't use gcc -shared on
Alexandre> Solaris even when the linker is GNU ld, but it must
Alexandre> certainly have failed for someone, at some time,
We're not using GNU ld in this case. The comment above the code to
directly use Solaris ld says:
# $CC -shared without GNU ld will not create a library from C++
# object files and a static libstdc++, better avoid it by now
(Here $CC is known to be GCC.)
That comment doesn't really make any sense. If you're using C++
object files, you always have to link with the C++ compiler; I bet
this predates the multi-language libtool.
I'm going to stick with changing ltcf-c.sh for now -- but I'm happy to
have you do something different later if you think that will be
better.
Thanks,
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
More information about the Gcc-bugs
mailing list