This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: RFC --enable-debugging
On Fri, Nov 01, 2002 at 01:25:29PM -0600, Loren James Rittle wrote:
> In article <20021101100743.48876aba.bkoz@redhat.com> you write:
> >
> >> 1) Is there any automated way to have the compiler pick the debug
> >> library when a program is linked with -g?
[...]
> Notice how one selects a libc based on provided command line
> arguments. In that situation, library name was changed based on
> arguments. In this case (BTW, I don't know how standard using
> $prefix/lib/debug really is), you want to effectively add a -L switch
> based on seeing -g.
1) Re $libdir/debug: well, it seems to be getting standardized on
Linux. :-) I was going to write this last night and got sidetracked:
how about an optional argument to --enable-debug, specifying the path to
the debug installation directory?
--enable-debug # same as
--enable-debug=debug # $libdir/debug == $prefix/lib/debug
--enable-debug=/foo # starts with '/' therefore not relative path
???
If we leave the path configurable, that solves the problem for all platforms.
There's also interaction with --enable-version-specific-runtime-libs, or
there should be.
2) I don't know that adding an -L.../debug upon seeing -g is either
desirable or effective, unless it's a static link, in which case it's both
effective and desirable.
For a debugging .so to be used, we'd need to change the rpath embedded in
the executable, and having -g do that automatically is something I would
argue against for many reasons. I won't list them until I need to. :-)
> One problem, it appears that libstdc++ is added by some magic inside
> gcc/cp/g++spec.c not the usual spec mechanism. However, a quik looks
> makes me think that it would be easier to obtain a portable change.
> Investigate usage of LIBSTDCXX_PROFILE.
Speaking of which, we don't build a profiled version either.
Phil
--
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
- Edsger Dijkstra, 1930-2002