manylinux2014-aarch64: fix libstdc++

This commit is contained in:
Jonas Vautherin
2026-03-04 00:08:24 +01:00
parent 8e64601fd2
commit da91964615
4 changed files with 2 additions and 61 deletions
-6
View File
@@ -170,10 +170,6 @@ web-wasi-threads: web-wasi web-wasi-threads/Dockerfile
# manylinux2014-aarch64 # manylinux2014-aarch64
# #
manylinux2014-aarch64: manylinux2014-aarch64/Dockerfile manylinux2014-x64 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 $@/ mkdir -p $@/imagefiles && cp -r imagefiles $@/
$(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux2014-aarch64:$(TAG) \ $(BUILD_DOCKER) $(BUILD_CMD) $(TAG_FLAG) $(ORG)/manylinux2014-aarch64:$(TAG) \
$(TAG_FLAG) $(ORG)/manylinux2014-aarch64:latest \ $(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"` \ --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
-f manylinux2014-aarch64/Dockerfile . -f manylinux2014-aarch64/Dockerfile .
rm -rf $@/imagefiles 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 manylinux2014-aarch64.test: manylinux2014-aarch64
$(TEST_DOCKER) run $(RM) $(ORG)/manylinux2014-aarch64:latest > $(BIN)/dockcross-manylinux2014-aarch64 \ $(TEST_DOCKER) run $(RM) $(ORG)/manylinux2014-aarch64:latest > $(BIN)/dockcross-manylinux2014-aarch64 \
+2 -3
View File
@@ -29,9 +29,8 @@ ENV PATH=${PATH}:${CROSS_ROOT}/bin
# Running scripts to cross compile python and copy libstdc++ into toolcain # Running scripts to cross compile python and copy libstdc++ into toolcain
ADD manylinux2014-aarch64/xc_script /tmp/ ADD manylinux2014-aarch64/xc_script /tmp/
RUN PASS=2 /tmp/docker_setup_scrpits/copy_libstd.sh RUN /tmp/docker_setup_scripts/prepare_cross_env.sh
RUN /tmp/docker_setup_scrpits/prepare_cross_env.sh RUN rm -rf /tmp/docker_setup_scripts
RUN rm -rf /tmp/docker_setup_scrpits
RUN rm -rf /tmp/usr/ RUN rm -rf /tmp/usr/
ENV AS=${CROSS_TRIPLE}-as \ ENV AS=${CROSS_TRIPLE}-as \
@@ -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