Enable static libgcc when CT_GDB_NATIVE_STATIC_LIBSTDCXX is set

This commit updates the GDB build script to specify `-static-libgcc`
when `CT_GDB_NATIVE_STATIC_LIBSTDCXX` is enabled. Both libgcc and
libstdc++ are considered to be part of the "standard libraries," and
should be specified by the same flag (the configuration symbol could
potentially use a better name and/or further indirection).

This also semantically aligns the `CT_GDB_NATIVE_STATIC_LIBSTDCXX`
with the equivalent GCC configuration `CT_CC_GCC_STATIC_LIBSTDCXX`,
which also enables static linking of both libgcc and libstdc++.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
Stephanos Ioannidis 2020-05-26 16:34:31 +09:00
parent b07da3bb69
commit 041427aec9

View File

@ -237,6 +237,7 @@ do_gdb_backend()
ldflags+=" -static"
fi
if [ "${static_libstdcxx}" = "y" ]; then
ldflags+=" -static-libgcc"
ldflags+=" -static-libstdc++"
fi