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 \
/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 && \