This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Hi List,
I am developing a C++ pure-template-library, with a lot of meta-programming
(expression templates).
With the default debugging level (-g2), the produced executable has a huge
size. Like, 300 kb for a simple program.
With -g1, the executable size is much more reasonable -- less than 150% of the
size obtained with -g0.
I believe that the main difference between -g1 and -g2 is that -g2 enables
source-code-line-number information. Also, "nm" tells me that there are very
few symbols (function names) in my executables.
I would like to do either of the following:
1) tell gcc to only emit line-number info for these lines of code that
actually produce code in the executable, after optimization.
2) tell gcc to just not emit any line-number info for the code inside my
template lib. Something like (I know that Pragma doesn't exist!):
_Pragma("dont_emit_line_number_info");
#include<MyTemplateLib/Headers>
_Pragma("end_of_dont_emit_line_number_info");
Is any of that possible? Do you see anything else that might help limit the
size of code generated by -g2?
Of course the users of my lib want to use -g2 not -g1 when compiling their own
app!
Thanks a lot in advance for any help,
Benoit
Attachment:
signature.asc
Description: This is a digitally signed message part.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |