This is the mail archive of the
mailing list for the libstdc++ project.
status on --enable-debug, --debug-libraries=c,c++
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, aoliva at redhat dot com, tromey at redhat dot com
- Date: Fri, 6 Dec 2002 13:43:56 -0600
- Subject: status on --enable-debug, --debug-libraries=c,c++
Last month, there was a thread on libstdc++ on options to increase
debuggability of linked C++ library code. There is ongoing work in
both g++ and gdb (interested people should seriously look into the -r
carlton_dictionary-branch of the current gdb sources), but there is
also work that needs to be done in libstdc++ to improve debugability.
This thread was called "[RFC] --enable-debug" and can be found
A summary of this thread is as follows:
would build a debug version of libstdc++, in addition
to the normal (optimized) build done currently
would specify the (non-default) flags with with to build said debug library
same as non-debug library.
(Debian already does this for libstdc++, other linux distros
including Red Hat do this with glibc and other system libraries)
something else, if name is different. One possibility would be
manually adding -L to compiler. no relinking should be necessary.
specifying a flag on the compile line that automatically selects
the correct library, like -static, or -pthread, but
--debug-libraries=c,stdc++. This involves dealing with
gcc/cp/g++spec.c's LIBSTDCXX and LIBSTDCXX_PROFILE, adding
something like LIBSTDCXX_DEBUG. Sketch by Loren:
no relinking should be necessary.
I've screwed around this week with an implementation, and didn't get
very far. Of the "or" branches above, I think the second one is more
involved but way, way more slick.
However, I'm having problems just getting a library + debug library built.
Possible implementation scenarios are as follows:
1) use the multilib infrastructure
2) make a separate 'debug' directory in the build tree and use that
3) try to hack something up with using an 'all-local' rule in src/Makefile.am
4) try to do conditional compilation hacks in src/Makefile.am a la
debug_library = libstdc++_debug.la
toolexeclib_LTLIBRARIES = libstdc++.la $(debug_library)
(I can't figure out how to have CXXFLAGS or equivalent be different
for libstdc++ and libstdc++_debug)
Right now, I'm leaning towards 1 or 2. Am I missing an approach that
would be easier? Does this sound like something that would generally