[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using a different C++ Standard Library
From: |
Ralf Wildenhues |
Subject: |
Re: Using a different C++ Standard Library |
Date: |
Thu, 15 Dec 2005 08:09:09 +0100 |
User-agent: |
Mutt/1.5.11 |
Hi Liviu,
* Liviu Nicoara wrote on Tue, Dec 13, 2005 at 08:17:38PM CET:
>
> I have problems in trying to get libtool to use the C++ standard library
> I want.
>
> I have my own C++ stdlib created with gcc on Linux. This library is
> compiled using gcc and linked with gcc; the only C++ library it links is
> libsupc++ which provides the language support. This C++ standard library
> is built using its own infrastructure, not autotools based.
>
> I want to use this library further in building another library - this
> library has an autotools based infrastructure. I indicate the include
> paths and the link paths and libraries (my stdlib and libsupc++) via
> CXXFLAGS, LDFLAGS, etc. in configure.ac and I see all the flags and
> options PRESENT in the Makefiles. Also, I set CXX to gcc in configure.ac
> in order to prevent the usage of g++. This results in the compilation of
> the library sources going as (trimmed for clarity):
Please post exactly how you configured. If you did not have -nostdlib
in CXXFLAGS nor LDFLAGSE, please try again configuring, and put it in
CXXFLAGS, or even like this
CXX='g++ -nostdlib'
(This hopefully can serve as a workaround until this libtool limitation
is fixed.) Untested, please post any issues that arise with this; you
may have to adjust LIBS to make $CXX link successfully in configure
tests.
> But the linking goes like this:
>
> ../libtool --tag=CXX --mode=link gcc -g
> -L/build/nicoara/11d-mystdlib/lib -lmystdlib -o libtools.la -rpath
> /usr/local/lib lib.lo
>
> g++ -shared -nostdlib
> /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../crti.o
> /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/crtbeginS.o .libs/lib.o
> -Wl,--rpath -Wl,/usr/lib/. -Wl,--rpath -Wl,/usr/lib/.
> -L/usr/lib/gcc-lib/i486-slackware-linux/../..
> -L/usr/lib/gcc-lib/i486-slackware-linux/../../../i486-slackware-linux/lib
> -L/usr/i486-slackware-linux/lib -L/usr/i486-slackware-linux/bin
> -L/build/nicoara/11d-mystdlib/lib -lmystdlib
> -L/usr/lib/gcc-lib/i486-slackware-linux/3.3.4
> -L/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/lib
> -L/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../..
> /usr/lib/./libstdc++.so -lm -lc -lgcc_s
> /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/crtendS.o
> /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../crtn.o -Wl,-soname
> -Wl,libtools.so.0 -o .libs/libtools.so.0.0.0
>
> My stdlib is buried deep within the list of lib paths and the linking
> process uses g++ although please notice that both compilation and
> linking phase use --tag=CXX and only the link uses g++. The end result
> is that I end up with symbols linked in from both gnu's stdc++ and my
> stdlib.
Yep. :-/
> My approach is probably fundamentally flawed as a consequence of my
> limited understanding of libtool's inner workings.
Nope, your understanding is not flawed. We need to implement a way to
specify:
- I want the C++ stdlib linked in
- I want (possibly) only minimal runtime lib linked in
- none of the above.
I think I wrote about this before, but can't find the mail quickly ATM,
and I don't have time to work on thie
Maybe we also need a way to just detect your C++ standard library.
> Any suggestion in how to implement this building process is welcome.
> Specifically I am interested in how to instruct the building process to
> use the C compiler instead of the C++ one when using my stdlib and/or
> how to instruct (force?) libtool in not bringing in the compiler's C++
> stdlib (GNU) in the link phase.
Hope that helps a bit. Please post your results, thank you.
Cheers,
Ralf