enable/disable-debug options to libstdc++-v3
Ranjit Mathew
rmathew@hotmail.com
Mon Oct 21 21:39:00 GMT 2002
Phil Edwards wrote:
> On Mon, Oct 21, 2002 at 04:29:00PM +0530, Ranjit Mathew wrote:
>
>>Now I did read in the configure.in comments that
>>these flags should not be specified for production
>>builds, but the problem is that I need to specify
>>--disable-debug for other parts of GCC and the top-level
>>configure blindly passes all flags to all components.
>>
>>Can these flags not be changed to "-g0" when
>>"--enable-debug=no"?
>>
>>Does it really make sense to say that "--disable-debug"
>>would mean that debug information would be put in
>>anyways?
>
>
> The point of --enable-debug, when it was first written into libstdc++,
> was to add /extra/ debugging information, mostly for our own use.
>
> Are you certain that the increased size is due to debug information?
> If that is the case, then
>
> 1) you can experiment with running 'strip' on the library, with
> various options, and
> 2) debug information is not loaded into memory at runtime; it takes
> up extra space on disk, but the memory footprint will not change.
>
> Try running 'strip' with different options, and if the size changes
> significantly, then it's debug information, and if the size is the same,
> then it's something else.
Yes, I'm positive that it is the debug information - on MinGW
at least, the generated libstdc++-v3 is 14MB(!) with debug
info and just 800K without - on my personal GCC build environment,
I apply the following patch before building:
-------------------------- 8< ------------------------------
--- acinclude.m4 Tue Oct 22 09:43:14 2002
+++ acinclude.m4 Tue Oct 22 09:43:41 2002
@@ -1029,5 +1029,5 @@
;;
no)
- DEBUG_FLAGS='-g'
+ DEBUG_FLAGS='-g0'
;;
esac
-------------------------- 8< ------------------------------
In fact, Danny Smith, the primary MinGW GCC/binutils maintainer
remarked in a post to the mingw-users list (where I'd raised
this issue) that he himself just uses "strip -g" on the library
before packaging it for distribution.
The difference in size might not impact run time performance
but it takes quite a bit of unnecessary disk space and has just
that little bit of impact at link time (IMHO).
Besides, as I remarked earlier, it is rather weird to say
that "--disable-debug" would put in a lot of debug
info anyways.
I haven't had the courage to see what monster is created
by the "--enable-debug" option. ;-)
Just my 2p.
Sincerely Yours,
Ranjit.
--
Ranjit Mathew Email: rmathew AT hotmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/
More information about the Libstdc++
mailing list