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.
This commit is contained in:
Julian Oes
2026-04-04 15:32:09 +13:00
parent 84419c14a5
commit ad3c0cad8c
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -52,6 +52,13 @@ COPY \
manylinux_2_34-aarch64/crosstool-ng.config \ manylinux_2_34-aarch64/crosstool-ng.config \
/dockcross/ /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. # Build and install the toolchain, cleaning up artifacts afterwards.
RUN \ RUN \
mkdir /dockcross/crosstool && \ mkdir /dockcross/crosstool && \
+1 -1
View File
@@ -562,7 +562,7 @@ CT_GCC_4_9_or_later=y
CT_CC_GCC_ENABLE_PLUGINS=y CT_CC_GCC_ENABLE_PLUGINS=y
CT_CC_GCC_GOLD=y CT_CC_GCC_GOLD=y
CT_CC_GCC_HAS_LIBMPX=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_CORE_EXTRA_CONFIG_ARRAY="--disable-gcov"
CT_CC_GCC_EXTRA_CONFIG_ARRAY="" CT_CC_GCC_EXTRA_CONFIG_ARRAY=""
CT_CC_GCC_STATIC_LIBSTDCXX=y CT_CC_GCC_STATIC_LIBSTDCXX=y