From ad3c0cad8c043e3c13db901727cab784e686181f Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Sat, 4 Apr 2026 15:32:09 +1300 Subject: [PATCH] manylinux_2_34: fix libstdc++ ABI mismatch by isolating host headers Using -I/usr/include during the crosstool-ng build of libstdc++ pulled in host x86_64 headers where int64_t is long long, contaminating the aarch64 cross-build where int64_t should be long. This caused linker errors for std::__atomic_futex_unsigned_base symbols due to mismatched C++ name mangling between headers and the built library. Copy only the required sys/sdt.h headers into /opt/ct-ng-includes and point CT_CC_GCC_ENABLE_CXX_FLAGS there instead, matching the approach used by manylinux_2_28-aarch64. --- common/common-manylinux_2_34.crosstool | 7 +++++++ manylinux_2_34-aarch64/crosstool-ng.config | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/common-manylinux_2_34.crosstool b/common/common-manylinux_2_34.crosstool index b7f96a6..728c6ec 100644 --- a/common/common-manylinux_2_34.crosstool +++ b/common/common-manylinux_2_34.crosstool @@ -52,6 +52,13 @@ COPY \ manylinux_2_34-aarch64/crosstool-ng.config \ /dockcross/ +# Copy sys/sdt.h to a clean include directory to avoid pulling in all of +# /usr/include (which causes __float128 conflicts on AlmaLinux 9 when +# cross-compiling for aarch64). +RUN mkdir -p /opt/ct-ng-includes/sys && \ + cp /usr/include/sys/sdt.h /opt/ct-ng-includes/sys/ && \ + cp /usr/include/sys/sdt-config.h /opt/ct-ng-includes/sys/ + # Build and install the toolchain, cleaning up artifacts afterwards. RUN \ mkdir /dockcross/crosstool && \ diff --git a/manylinux_2_34-aarch64/crosstool-ng.config b/manylinux_2_34-aarch64/crosstool-ng.config index 69bda96..8af2642 100644 --- a/manylinux_2_34-aarch64/crosstool-ng.config +++ b/manylinux_2_34-aarch64/crosstool-ng.config @@ -562,7 +562,7 @@ CT_GCC_4_9_or_later=y CT_CC_GCC_ENABLE_PLUGINS=y CT_CC_GCC_GOLD=y CT_CC_GCC_HAS_LIBMPX=y -CT_CC_GCC_ENABLE_CXX_FLAGS="-I/usr/include -fpermissive" +CT_CC_GCC_ENABLE_CXX_FLAGS="-I/opt/ct-ng-includes -fpermissive" CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY="--disable-gcov" CT_CC_GCC_EXTRA_CONFIG_ARRAY="" CT_CC_GCC_STATIC_LIBSTDCXX=y