This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: RFC --enable-debugging
On Wed, Nov 06, 2002 at 05:51:14PM -0600, Benjamin Kosnik wrote:
> Perhaps the terminology should just be "library explicitly for use when
> debugging."
Sounds good to me.
> >However, I think the ultimate extension of this idea would be
> >something like:
> >
> > g++ --debug-libraries=c,stdc++,foo -o widget widget.o -lfoo -lbar
> >
> >This would allow a user to specify for which libraries debugging
> >versions should be considered. Here, libfoo, libc, and libstdc++
> >would have debugging versions used, while a non-debugging version of
> >libbar would be linked in.
>
> Hmm. This is getting more and more interesting. How would this translate
> to the debug libc on linux though? These sources are not in gcc proper.
>
> What would this mean for -lbar as above? Since g++ will not know
> anything about libbar, where would it look for the debug version of
> libbar?
Well, actually, gcc won't look for the debug version of libbar. But
the same applies for libfoo, which was specified as a "debug
library". The search for libbar will have to be done the normal way.
As Gaby says, gcc knows or could know the rule for finding debug
versions of libraries implicitly. For example, from what I'm hearing,
on Linux platforms, directories like /usr/lib/debug contain debug
versions of the /usr/lib libraries (and presumably,
/.../gcc/.../lib/debug would also exist). On other systems, perhaps
debug libraries are tagged by having "_g" after their name.
The problem with the Linux scheme, is that we would need linker
support to say "search here for these libraries, but not for these
other ones". For example, the following is insufficient, because if a
debug version of libbar exists, it will be selected.
linker -L/usr/lib/debug -L/usr/lib -lfoo -lbar
It looks like GNU ld's --start-group and --end-group don't serve to
localize the library search path, either.
So perhaps the "ultimate" version of the option is beyond our grasp,
but it provides a good goal, I think. Maybe the linker really needs
the option to allow selection of alternate library versions on a
per-library basis?
--
------------------------------------------------------------------
Brad Spencer - spencer@infointeractive.com - "It's quite nice..."
Systems Architect | InfoInterActive Corp. | A Canadian AOL Company