This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: RFC --enable-debugging
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Fri, 1 Nov 2002 13:25:29 -0600 (CST)
- Subject: Re: RFC --enable-debugging
- Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs
- References: <m3of98w1sg.fsf@soliton.integrable-solutions.net>
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?
>
> Don't think so. I think the (prefix)/lib/debug is pretty standard. I
> know glibc uses it, and as Phil indicated, Debian has already started to
> do this with libstdc++.
If libstdc++ were selected like libc, it is an easy trick to teach the
compiler how to do this with the spec file. However, getting a patch
done that is acceptable for all platforms is tough for me at the
moment.
If anyone wants to do it, check this sample:
*lib:
%{!shared: %{!pg: %{!pthread:-lc} %{pthread:-lc_r}}
%{ pg: %{!pthread:-lc_p} %{pthread:-lc_r_p}}}
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.
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.
Regards,
Loren