From d5e781d415393b36b8674fa14952fb172c4d25cf Mon Sep 17 00:00:00 2001 From: hanzongcheng Date: Fri, 2 Sep 2022 17:20:24 +0800 Subject: [PATCH] ct-ng: modify gcc configure for x86 cross compiler * According to GCC Manuals, the default ABI is determined by whether gcc was compiled with the "--with-default-libstdcxx=c++98", "--with-default-libstdcxx=c++11" or "--disable-libstdcxx-dual-abi" flags. The last of those sticks with the gcc-3.1/4.* ABI and does not provide the new one at all. The other two compile libstdc++ with both ABIs, and differ only in the default. We currently disable libstdcxx-dual-abi, so users cannot use the c11 abi, which causes the following problems: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_M_local_dataEv Enable the dual abi and user programs can override the default by defining "_GLIBCXX_USE_CXX11_ABI" when compiling the program. * In addition, according to the configure of the openeuler gcc, add some new options: --enable-gnu-indirect-function --with-stage1-ldflags='-Wl,-z,relro,-z,now' --with-boot-ldflags='-Wl,-z,relro,-z,now' --with-tune=generic --disable-multilib By default, C99 support is on, so remove "--enable-c99". Signed-off-by: hanzongcheng --- cross_tools/configs/config_x86_64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cross_tools/configs/config_x86_64 b/cross_tools/configs/config_x86_64 index cc78145d..fabdf09a 100644 --- a/cross_tools/configs/config_x86_64 +++ b/cross_tools/configs/config_x86_64 @@ -601,7 +601,7 @@ CT_CC_GCC_GOLD=y CT_CC_GCC_HAS_LIBMPX=y CT_CC_GCC_ENABLE_CXX_FLAGS="" CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY="" -CT_CC_GCC_EXTRA_CONFIG_ARRAY="--with-arch=x86-64 --with-gnu-as --with-gnu-ld --enable-c99 --enable-shared --enable-poison-system-directories --enable-symvers=gnu --disable-bootstrap --disable-libstdcxx-dual-abi --enable-default-pie --libdir=\"${CT_PREFIX_DIR}/lib64\" --with-build-time-tools=\"${CT_PREFIX_DIR}/${CT_TARGET}/bin\"" +CT_CC_GCC_EXTRA_CONFIG_ARRAY="--enable-gnu-indirect-function --with-stage1-ldflags='-Wl,-z,relro,-z,now' --with-boot-ldflags='-Wl,-z,relro,-z,now' --with-tune=generic --with-arch=x86-64 --disable-multilib --with-gnu-as --with-gnu-ld --enable-shared --enable-poison-system-directories --enable-symvers=gnu --disable-bootstrap --enable-default-pie --libdir=\"${CT_PREFIX_DIR}/lib64\" --with-build-time-tools=\"${CT_PREFIX_DIR}/${CT_TARGET}/bin\"" CT_CC_GCC_STATIC_LIBSTDCXX=y # CT_CC_GCC_SYSTEM_ZLIB is not set CT_CC_GCC_CONFIG_TLS=m -- Gitee