From da91964615cb8caa8876acce383d9896c40de0fa Mon Sep 17 00:00:00 2001 From: Jonas Vautherin Date: Wed, 4 Mar 2026 00:08:24 +0100 Subject: [PATCH] manylinux2014-aarch64: fix libstdc++ --- Makefile | 6 --- manylinux2014-aarch64/Dockerfile.in | 5 +- .../prepare_cross_env.sh | 0 .../docker_setup_scrpits/copy_libstd.sh | 52 ------------------- 4 files changed, 2 insertions(+), 61 deletions(-) rename manylinux2014-aarch64/xc_script/{docker_setup_scrpits => docker_setup_scripts}/prepare_cross_env.sh (100%) delete mode 100755 manylinux2014-aarch64/xc_script/docker_setup_scrpits/copy_libstd.sh diff --git a/Makefile b/Makefile index a269bad..e88d1c8 100644 --- a/Makefile +++ b/Makefile @@ -170,10 +170,6 @@ web-wasi-threads: web-wasi web-wasi-threads/Dockerfile # manylinux2014-aarch64 # manylinux2014-aarch64: manylinux2014-aarch64/Dockerfile manylinux2014-x64 - @# Register qemu - docker run --rm --privileged hypriot/qemu-register - @# Get libstdc++ from quay.io/pypa/manylinux2014_aarch64 container - docker run -v `pwd`:/host --rm -e LIB_PATH=/host/$@/xc_script/ quay.io/pypa/manylinux2014_aarch64 bash -c "PASS=1 /host/$@/xc_script/docker_setup_scrpits/copy_libstd.sh" mkdir -p $@/imagefiles && cp -r imagefiles $@/ $(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux2014-aarch64:$(TAG) \ $(TAG_FLAG) $(ORG)/manylinux2014-aarch64:latest \ @@ -184,8 +180,6 @@ manylinux2014-aarch64: manylinux2014-aarch64/Dockerfile manylinux2014-x64 --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ -f manylinux2014-aarch64/Dockerfile . rm -rf $@/imagefiles - @# libstdc++ is coppied into image, now remove it - docker run -v `pwd`:/host --rm quay.io/pypa/manylinux2014_aarch64 bash -c "rm -rf /host/$@/xc_script/usr" manylinux2014-aarch64.test: manylinux2014-aarch64 $(TEST_DOCKER) run $(RM) $(ORG)/manylinux2014-aarch64:latest > $(BIN)/dockcross-manylinux2014-aarch64 \ diff --git a/manylinux2014-aarch64/Dockerfile.in b/manylinux2014-aarch64/Dockerfile.in index 891c502..1665535 100644 --- a/manylinux2014-aarch64/Dockerfile.in +++ b/manylinux2014-aarch64/Dockerfile.in @@ -29,9 +29,8 @@ ENV PATH=${PATH}:${CROSS_ROOT}/bin # Running scripts to cross compile python and copy libstdc++ into toolcain ADD manylinux2014-aarch64/xc_script /tmp/ -RUN PASS=2 /tmp/docker_setup_scrpits/copy_libstd.sh -RUN /tmp/docker_setup_scrpits/prepare_cross_env.sh -RUN rm -rf /tmp/docker_setup_scrpits +RUN /tmp/docker_setup_scripts/prepare_cross_env.sh +RUN rm -rf /tmp/docker_setup_scripts RUN rm -rf /tmp/usr/ ENV AS=${CROSS_TRIPLE}-as \ diff --git a/manylinux2014-aarch64/xc_script/docker_setup_scrpits/prepare_cross_env.sh b/manylinux2014-aarch64/xc_script/docker_setup_scripts/prepare_cross_env.sh similarity index 100% rename from manylinux2014-aarch64/xc_script/docker_setup_scrpits/prepare_cross_env.sh rename to manylinux2014-aarch64/xc_script/docker_setup_scripts/prepare_cross_env.sh diff --git a/manylinux2014-aarch64/xc_script/docker_setup_scrpits/copy_libstd.sh b/manylinux2014-aarch64/xc_script/docker_setup_scrpits/copy_libstd.sh deleted file mode 100755 index 1a147d1..0000000 --- a/manylinux2014-aarch64/xc_script/docker_setup_scrpits/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