1
votes

I configured gcc as follows:

../configure --prefix=/c/mbuild/release --enable-shared=libstdc++ --enable-threads --enable-version-specific-runtime-libs --enable-languages=c,c++ --with-dwarf2 --disable-sjlj-exceptions --disable-win32-registry --disable-werror --disable-nls --disable-multilib --with-gmp=/c/mbuild/release --with-ppl=/c/mbuild/release --disable-ppl-version-check --with-cloog=/c/mbuild/release --disable-cloog-version-check --with-mpfr=/c/mbuild/release --with-mpc=/c/mbuild/release --enable-libgomp --with-libiconv-prefix=/c/mbuild/release --enable-libstdcxx-debug --enable-cxx-flags='-s -O2' *--with-boot-ldflags='-s'* --with-boot-cflags='-s -O2' --with-boot-cxxflags='-s -O2' &>config.my.log

and build:

make -j4 BOOT_CFLAGS='-s -O2' BOOT_CPPFLAGS='-s -O2' &>make.my.log

I've got everything optimized, except libstdc++-6.dll. It size is 5Mb!
So... What options should i use during gcc (mingw) configuration to build libstdc++.dll without debugging information?

NOTE:
I need debug and release versions of libstdc++, so I'm using
--enable-libstdcxx-debug - Build separate debug libraries in addition to what is normally built.
This flag makes another libstdc++-6.dll (somwhere in lib dir), wich is larger, than dll in the bin dir.

1
You should be able to call the strip command after the fact (do save the original lib and read the doc, it may take a few tries to get the right options).Marc Glisse
FYI: I have not seen any official documentation around BOOT_CPPFLAGS or BOOT_CXXFLAGS -- only BOOT_CFLAGS.kevinarpe

1 Answers

0
votes

You should pass strip option to linker, not to compiler (-s). And to compiler you should pass "-g -O0" for debug build, which means include debug information + stright code generation without any optimization (the last one is for case you read disasm code, it makes stuff clearer). So, try adding to LDFLAGS environment variable -s option for build time.

As an alternative, you could use "strip" program (part of MSYS) to strip all debug info from executable and/or library binary file.