Binary size of the libstdc++.so library

Benjamin Kosnik bkoz@cygnus.com
Sat Apr 1 00:00:00 GMT 2000


>   Are there any major things that I can do to reduce its size?

Start looking at using some of the size-saving flags. 

In particular (from src/Makefile.am)

# OPTIMIZE_CXXFLAGS = -fsquangle -fnew-exceptions \
#                  -ffunction-sections -fvtable-gc -Wl,--gc-sections

1) -fnew-exceptions  == this looked like a 10% savings
2) -fsquangle == compress symbol names
3) -ffunction-sections -fvtable-gc -Wl,--gc-sections == implement
selective linking

Also try searching this newsgroup: it's come up a couple times. Item 3)
still needs support from gcc/ld/binutils folks for -fPIC. It's been broken
for quite some time. Perhaps the only way it will ever get done is if some
beneficent company pays for it, sadly--it doesn't seem to be a big
priority to gcc folks.

-benjamin



More information about the Libstdc++ mailing list