RE: Library tripled in size with GCC 4.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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? Clearly, debugging info is the only thing bigger. Debugging sections won't get loaded into ram, and should have no effect on the execution speed. As for size, I can't think of any reason to keep a debug-enabled library around unless you're actively developing it. I think you can strip debug info from it, store it in a separate file, and compress that file if need be.

- Alex


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux