On Oct 15, 2008, at 2:37 PM, Austin, Alex wrote:
From: gcc-help-owner@xxxxxxxxxxx [mailto:gcc-help-
owner@xxxxxxxxxxx] On Behalf Of Eric Gorr
Sent: Wednesday, October 15, 2008 1:03 PM
To: gcc-help@xxxxxxxxxxx
Subject: Library tripled in size with GCC 4.2
I am using GCC 4.2 with Mac OS X 10.5 and Xcode 3.1.1
When I build my library under GCC 4.0, the static library is ~400mb.
If the only switch I make is to GCC 4.2, that same library is ~1.2GB.
The issue seems to be with the amount of debugging information
generated as when I build the release version, GCC 4.2 produces a
smaller library then GCC 4.0.
I believe the only relevant flag that I am using is -gdwarf-2 for
both
GCC 4.2 and GCC 4.0.
Is GCC 4.2 adding a far greater amount of debugging information to
the
library?
What flags can control this?
The flags I found were:
-feliminate-dwarf2-dups
However, this flag generated a bunch of the following errors:
{standard input}:50796:Expected comma after segment-name
{standard input}:50796:Rest of line ignored. 1st junk character
valued
32 ( ).
-feliminate-unused-debug-types
This flag didn't seem to affect the size of the library at all.
-glevel
I cannot go down to level 1 because of the information that would not
be included.
I cannot go up to level 3 because that would appear to just make the
library bigger.
Any comments, hints or suggestions?
Does the size really matter?
Yes.
The reason is because after a little more was added to the library, it
became to big for the linker to work with it - perhaps a bug in the
version of GCC 4.2 being used by Xcode 3.1.1?
I am hoping to avoid the work required to split the library into two
smaller libraries.
And, yes, this is a library that is being actively developed, so
stripping things from it isn't practical.
Is it expected for debug versions of libraries to dramatically
increase in size when moving from GCC 4.0 to GCC 4.2?
Are there any flags I have missed that might allow the actively
developed library to safely become smaller?
thanks.