This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC --enable-debugging


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]