toolchain/libstdcpp: disable dual ABI and default to new
authorRosen Penev <rosenp@gmail.com>
Thu, 21 Jan 2021 04:51:45 +0000 (20:51 -0800)
committerPaul Spooren <mail@aparcar.org>
Wed, 27 Jan 2021 01:23:06 +0000 (15:23 -1000)
GCC 5.1 changed the std::string ABI in order to properly support C++11.
For compatibility with libraries compiled with the older ABI, that is,
linking between old-abi.so and new-abi.bin, both ABIs are enabled. In
terms of OpenWrt, all packages are compiled with the same toolchain,
which means these issues do not need to be handled.

Most importantly, this results in a significant size reduction of
libstdpp:

Before:

450794 bytes

After:

327752 bytes

Tested with all OpenWrt packages.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
toolchain/gcc/common.mk

index aaddb74642f82ef763302420d5e5e599cf163cad..55fad1fcc48d64cb0cf51d2cdedc9c6b01da01d6 100644 (file)
@@ -117,7 +117,9 @@ GCC_CONFIGURE:= \
                --with-mpc=$(TOPDIR)/staging_dir/host \
                --disable-decimal-float \
                --with-diagnostics-color=auto-if-env \
-               --enable-__cxa_atexit
+               --enable-__cxa_atexit \
+               --disable-libstdcxx-dual-abi \
+               --with-default-libstdcxx-abi=new
 ifneq ($(CONFIG_mips)$(CONFIG_mipsel),)
   GCC_CONFIGURE += --with-mips-plt
 endif