Reputation: 679
I would like to improve the build speed of a large project. The opt build is compiled with -O2 -g. I noticed that without -g, compilation becomes faster, about 10-20%. The resulting binary has enough information to analyze crashes, except for the line numbers. Is there a way to include line number information but nothing else?
According to http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html, line numbers are produced only at level 2 (i.e. -g2 or the default of -g) or above. But according to this http://gcc.gnu.org/wiki/DebugFission, line numbers are only a fraction of the debug information (1%). So for me it would be best to have -g0 or -g1 but with line numbers. Is this possible?
Best regards, Martin
Upvotes: 11
Views: 5755
Reputation: 2090
Time has passed.
GCC know includes line numbers with -g1
.
You can also add two more options to save more space: -g1 -gz -gsplit-dwarf
Upvotes: 3
Reputation: 679
Googling the Clang option mentioned by Matthieu, I found a patch for gcc that does what I want. It has been submitted for trunk but has been pending since two years. This means stock GCC is not able to do this, but with this patch it can do it using the option "-gmlt"
Upvotes: 7
Reputation: 299850
Could you be mistaken ? I know that Clang supports -gline-tables-only
, however as far as I could see gcc does not; it does support -g1
, but there is no line information.
Upvotes: 6