Stipping away locale support
Loren James Rittle
rittle@latour.rsch.comm.mot.com
Fri Aug 15 01:26:00 GMT 2003
> I'm building an embedded C++ application and I'm
> suffering serious bloat caused by libstdc++.
> My application is quite small and uses only basic C++
> features (no threading, no wchar, no iostreams and no STL),
> but somehow all of the C locale stuff gets linked in,
> bringing several other things with it (formatters, etc.).
Telling us what you don't use is not helpful... ;-) In the future,
please tell us what you do use...
> With GCC 3.3.1, the text+data size was 384KB. In GCC 3.4,
> the size increased to 682KB. This is a serious regression.
Please report exactly what you are doing. Based on what you have said
above, I can assume the following:
- you added -static (or it is the port default)
- you probably use std::string
- you indeed ran 'size' instead of 'ls -l'
S rittle@latour; cat t.C
#include <string>
main(){std::string a;}
S rittle@latour; g++32 -static -O2 t.C
S rittle@latour; size a.out
text data bss dec hex filename
206372 46440 39256 292068 474e4 a.out
S rittle@latour; /usr/local/beta-gcc/bin/g++ -static -O2 t.C
S rittle@latour; size a.out
text data bss dec hex filename
307960 5320 38740 352020 55f14 a.out
Yes, that would be a tad annoying to an embedded developer...
Here, I see locale stuff linked into both version.
Benjamin, did locale support really balloon that much between 3.2 and
mainline or is something else in the build machinery worth looking at?
Regards,
Loren
More information about the Libstdc++
mailing list