Debug size + PCH = Pb ! ?

"Sébastien L." sleon@pointcarre.com
Fri Jun 10 09:23:00 GMT 2005


Hello,

I have a big problem with the debug version of my software.
The release binary size is 12 Mo on Linux (gcc 3.4.3) and 16 Mo on Mac 
OS X ("Apple" gcc 3.3).
However the debug version is really huge :
- 250 Mo for Linux debug binary !
- more than 1300 Mo (1.3 Go) for Mac OS X binary !!!
The Mac OS X one is so big that ld fail to link with a memory allocation 
error message. I simply can't work :-(
Of course, even with Linux version, many basic operations are very 
painful (recompile one file and relink)...
I suspect the precompiled header for doing so bad things.
And gcc behavior is definitly not the same on Mac or on Linux.
For an example, an empty file (just #include <pch.h>) generate an object 
file (foo.o) of 120 Ko in Linux.
For the same file, same project, the generate foo.o is 4 Ko in Mac OS X.
However, for a very small cpp file (50 lines of code), the Linux 
generate a 124 Ko object file and the Mac gcc generate a 650 Ko ! ?
Our precompiled header is big because it contains qt.h (all Trolltech 
headers) and our private headers. But without the pch, it is REALLY 
painful to compile our software (with pch : 30 minutes ; without pch : 2 
hours ! - with powerfull computer)
(when I read the obj as a text file I find many thousand unused symbols 
inside)
For info, the Windows binary files (VC++) are : 3 Mo (release) and 11 Mo 
(debug)

I am right when I suspect pch ?
Did anyone experienced the same problem ?
Does gcc4 solve it ? (the problem is qtMac doesn't compile with gcc4)
Any idea to solve that ?

Thank you for your help.



More information about the Gcc-help mailing list