mirror of
https://github.com/bensuperpc/dockcross.git
synced 2026-07-26 04:48:08 +02:00
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:
@@ -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 && \
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user