From 4fb4c4e401d6fe7e74337c0e3efbd00afbeb500f Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Fri, 3 Apr 2026 06:50:09 +1300 Subject: [PATCH] Remove copy_libstd.sh workaround from manylinux_2_34-aarch64 The libstdc++ copy trick is no longer needed, as noted in PR #931 which removed it for manylinux2014-aarch64. --- Makefile | 6 --- manylinux_2_34-aarch64/Dockerfile.in | 3 +- .../docker_setup_scripts/copy_libstd.sh | 52 ------------------- 3 files changed, 1 insertion(+), 60 deletions(-) delete mode 100755 manylinux_2_34-aarch64/xc_script/docker_setup_scripts/copy_libstd.sh diff --git a/Makefile b/Makefile index 6fa2038..40200c3 100644 --- a/Makefile +++ b/Makefile @@ -209,10 +209,6 @@ manylinux_2_28-aarch64.test: manylinux_2_28-aarch64 # manylinux_2_34-aarch64 # manylinux_2_34-aarch64: manylinux_2_34-aarch64/Dockerfile manylinux_2_34-x64 - @# Register qemu - docker run --rm --privileged hypriot/qemu-register - @# Get libstdc++ from quay.io/pypa/manylinux_2_34_aarch64 container - docker run -v `pwd`:/host --rm -e LIB_PATH=/host/$@/xc_script/ quay.io/pypa/manylinux_2_34_aarch64 bash -c "PASS=1 /host/$@/xc_script/docker_setup_scripts/copy_libstd.sh" mkdir -p $@/imagefiles && cp -r imagefiles $@/ $(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux_2_34-aarch64:$(TAG) \ $(TAG_FLAG) $(ORG)/manylinux_2_34-aarch64:latest \ @@ -223,8 +219,6 @@ manylinux_2_34-aarch64: manylinux_2_34-aarch64/Dockerfile manylinux_2_34-x64 --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ -f manylinux_2_34-aarch64/Dockerfile . rm -rf $@/imagefiles - @# libstdc++ is copied into image, now remove it - docker run -v `pwd`:/host --rm quay.io/pypa/manylinux_2_34_aarch64 bash -c "rm -rf /host/$@/xc_script/usr" manylinux_2_34-aarch64.test: manylinux_2_34-aarch64 $(TEST_DOCKER) run $(RM) $(ORG)/manylinux_2_34-aarch64:latest > $(BIN)/dockcross-manylinux_2_34-aarch64 \ diff --git a/manylinux_2_34-aarch64/Dockerfile.in b/manylinux_2_34-aarch64/Dockerfile.in index 8c05b1d..dff80d2 100644 --- a/manylinux_2_34-aarch64/Dockerfile.in +++ b/manylinux_2_34-aarch64/Dockerfile.in @@ -27,9 +27,8 @@ ENV CROSS_TRIPLE=aarch64-unknown-linux-gnu ENV CROSS_ROOT=${XCC_PREFIX}/${CROSS_TRIPLE} ENV PATH=${PATH}:${CROSS_ROOT}/bin -# Running scripts to cross compile python and copy libstdc++ into toolchain +# Running scripts to cross compile python ADD manylinux_2_34-aarch64/xc_script /tmp/ -RUN PASS=2 /tmp/docker_setup_scripts/copy_libstd.sh RUN /tmp/docker_setup_scripts/prepare_cross_env.sh RUN rm -rf /tmp/docker_setup_scripts RUN rm -rf /tmp/usr/ diff --git a/manylinux_2_34-aarch64/xc_script/docker_setup_scripts/copy_libstd.sh b/manylinux_2_34-aarch64/xc_script/docker_setup_scripts/copy_libstd.sh deleted file mode 100755 index 1a147d1..0000000 --- a/manylinux_2_34-aarch64/xc_script/docker_setup_scripts/copy_libstd.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -# AUTHOR: odidev -# DATE: 2021-07-20 -# DESCRIPTION: This file is invoked two times. first time from Makefile with -# PASS == 1 and second time in Dockerfile.in with PASS == 2. In -# dockcross container, the current libstdc++ is not the same as -# in manylinux containers. So, copying the libstdc++ form manylinux -# container to dockcross container. It is being done int 2 pass. -# during PASS == 1, the script will copy libstdc++ from manylinux -# container to build machine and then during PASS == 2, libstdc++ -# will be copied from build machine to dockcross container - -if [ $PASS == 1 ]; then - echo "library location on host: " ${LIB_PATH} - echo "PASS 1: copying libstdc++ library on host" - files=$(rpm -ql libstdc++) - for file in ${files}; do - if [ -f ${file} -a ! -L ${file} -a ! -d ${file} ]; then - if grep -q "shared object" <<< $(file $file); then - install -m 0644 -D ${file} "${LIB_PATH}${file}" - break; - fi - fi - done - echo "Done" -elif [ $PASS == 2 ]; then - echo "PASS 2: copying libstdc++ library in docker image" - old_libstdc_path=$(find /usr/xcc/ -name libstdc++.so*[0-9] -type f) - old_libstdc_directory=$(dirname "${old_libstdc_path}") - target_libstdc_path=$(find /tmp -name libstdc++.so*[0-9] -type f) - target_libstdc_filename=$(basename "${target_libstdc_path}") - target_libstdc_new_path=${old_libstdc_directory}/${target_libstdc_filename} - install -m 0555 -D ${target_libstdc_path} ${target_libstdc_new_path} - echo "Done" - links=$(find /usr/xcc/ \( -name libstdc++.so*[{0-9}] -o -name libstdc++.so \) -type l) - echo "Creating soft links for target libstdc++ library" - for link in ${links}; do - case "$link" in - (*libstdc++.so*[{0-9}].[{0-9}].[{0-9}]*) - target_libstdc_filename=$(basename "${target_libstdc_new_path}") - libstdc_link_directory=$(dirname "${link}") - rm -rf $link - target_libstdc_link_path=${libstdc_link_directory}/${target_libstdc_filename} - ln -sf ${target_libstdc_new_path} ${target_libstdc_link_path} - ;; - (*) - ln -sf ${target_libstdc_new_path} ${link} - esac - done - echo "Done" -fi