Skip to content

Commit 2324827

Browse files
authored
Remove --enable-libstdcxx-debug from build.sh (#31)
This option causes GCC to build and install a second copy of libstdc++.so and libstdc++.a (for each multilib) which is built with `-g3 -O0 -D_GLIBCXX_ASSERTIONS` instead of `-g3 -O2` These duplicate libs are intended to help when trying to step into libstdc++.so with GDB, mostly for the purposes of debugging libstdc++.so itself. That isn't possible on Compiler Explorer, because you can't run GDB. Unless I'm missing something, it's not even really possible to link to these alternative libs, because they're installed in a path like `$prefix/lib64/debug` and users would need to know that path and then set it in the options with `-L` to find the alternative libs. When using CE just to compile code, this is completely pointless, it doesn't make any difference which lib gets linked to if you just want to compile to assembly. When using CE for execution, this is also completely pointless unless the user either passes the path with `-L` and links statically (e.g. `-static-libstdc++`) or somehow arranges for the debug libs to be found by the dynamic linker at runtime, e.g. using `-Wl,-rpath,...` or somehow setting `LD_RUN_PATH` or `LD_LIBRARY_PATH` in the environment. Even if they do all that ... what's the point? They can't use GDB to debug the internals of libstdc++ anyway. So it seems to me that using this configure option is just doubling the disk space needed by each gcc build, because you're installing useless `-O0` copies of libstdc++ for each multilib (-m32, -m64, and -mx32).
1 parent a1b069a commit 2324827

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

build/build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ CONFIG+=" --enable-clocale=gnu"
283283
CONFIG+=" --enable-languages=${LANGUAGES}"
284284
CONFIG+=" --enable-ld=yes"
285285
CONFIG+=" --enable-gold=yes"
286-
CONFIG+=" --enable-libstdcxx-debug"
287286
CONFIG+=" --enable-libstdcxx-time=yes"
288287
CONFIG+=" --enable-linker-build-id"
289288
CONFIG+=" --enable-lto"

0 commit comments

Comments
 (0)