mirror of
https://github.com/bensuperpc/dockcross.git
synced 2025-06-10 21:19:26 +02:00
Add manylinux2014-aarch64 with gcc=9.3
This commit is contained in:
52
manylinux2014-aarch64/xc_script/docker_setup_scrpits/copy_libstd.sh
Executable file
52
manylinux2014-aarch64/xc_script/docker_setup_scrpits/copy_libstd.sh
Executable file
@ -0,0 +1,52 @@
|
||||
#!/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
|
113
manylinux2014-aarch64/xc_script/docker_setup_scrpits/prepare_cross_env.sh
Executable file
113
manylinux2014-aarch64/xc_script/docker_setup_scrpits/prepare_cross_env.sh
Executable file
@ -0,0 +1,113 @@
|
||||
#!/bin/bash
|
||||
|
||||
# AUTHOR: odidev
|
||||
# DATE: 2021-07-20
|
||||
# DESCRIPTION: This file intended to cross compile the python and create necessary
|
||||
# crossenv enrironment
|
||||
|
||||
# The current env is not compatible to build python so resetting it as
|
||||
# in quay.io/pypa/manylinux2014_x86_64 containers
|
||||
unset $(env | awk -F= '{print $1}')
|
||||
export SSL_CERT_FILE=/opt/_internal/certs.pem
|
||||
export TERM=xterm
|
||||
export LC_ALL=en_US.UTF-8
|
||||
export LD_LIBRARY_PATH=/opt/rh/devtoolset-9/root/usr/lib64:/opt/rh/devtoolset-9/root/usr/lib:/opt/rh/devtoolset-9/root/usr/lib64/dyninst:/opt/rh/devtoolset-9/root/usr/lib/dyninst:/usr/local/lib64
|
||||
export PATH=/opt/rh/devtoolset-9/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
export PWD=/work
|
||||
export LANG=en_US.UTF-8
|
||||
export AUDITWHEEL_ARCH=x86_64
|
||||
export DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-9/root
|
||||
export HOME=/root
|
||||
export SHLVL=1
|
||||
export LANGUAGE=en_US.UTF-8
|
||||
export AUDITWHEEL_PLAT=manylinux2014_aarch64
|
||||
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
|
||||
export AUDITWHEEL_POLICY=manylinux2014
|
||||
|
||||
# Cross compile Python versions present in manylinux containers
|
||||
declare -A buildpy
|
||||
python_vers=""
|
||||
|
||||
for PY in /opt/python/cp*/bin/python; do
|
||||
ver=`$PY --version | cut -d " " -f 2`
|
||||
python_vers="${python_vers} ${ver}"
|
||||
cpver=cp`echo ${ver} | cut -d "." -f 1-2 | sed 's/\.//'`
|
||||
if [ ${cpver} = "cp36" ] || [ ${cpver} = "cp37" ]; then
|
||||
cpver="${cpver}-${cpver}m"
|
||||
else
|
||||
cpver="${cpver}-${cpver}"
|
||||
fi
|
||||
buildpy[${ver}]=${cpver}
|
||||
done
|
||||
|
||||
|
||||
# Adding cross compiler path in PATH env variable
|
||||
export PATH=/usr/xcc/aarch64-unknown-linux-gnueabi/bin:$PATH
|
||||
|
||||
OLD_PATH=$PATH
|
||||
CROSS_PY_BASE=/opt/_internal
|
||||
CROSS_PY_BASE_LN=/opt/python
|
||||
BUILD_DIR=/tmp/builds
|
||||
LN=ln
|
||||
sub_rel=""
|
||||
|
||||
# Loop over each python version and cross compile it
|
||||
for python_ver in $python_vers; do
|
||||
rel=""
|
||||
sub_rel=""
|
||||
found_sub_rel=0
|
||||
for i in ` seq ${#python_ver}`
|
||||
do
|
||||
c=${python_ver:$i-1:1}
|
||||
if [[ ${c} == [a-zA-Z] ]] ; then
|
||||
found_sub_rel=1
|
||||
fi
|
||||
if [[ $found_sub_rel == "0" ]]; then
|
||||
rel=${rel}${c}
|
||||
else
|
||||
sub_rel=${sub_rel}${c}
|
||||
fi
|
||||
done
|
||||
|
||||
mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
|
||||
wget https://www.python.org/ftp/python/${rel}/Python-${rel}${sub_rel}.tgz
|
||||
tar xzf Python-${rel}${sub_rel}.tgz
|
||||
cd Python-${rel}${sub_rel}
|
||||
|
||||
# Setting up build python path required by crassenv
|
||||
BUILD_PYBIN=${CROSS_PY_BASE_LN}/${buildpy[$python_ver]}/bin
|
||||
BUILD_PIP=${BUILD_PYBIN}/pip3
|
||||
BUILD_PYTHON=${BUILD_PYBIN}/python3
|
||||
|
||||
# Setting up target python required by crossenv
|
||||
TARGET_PYPATH=${CROSS_PY_BASE}/xc/xcpython-${python_ver}
|
||||
TARGET_PYTHON=${TARGET_PYPATH}/bin/python3
|
||||
|
||||
# Setting up cross env path
|
||||
CROSS_ENV=${CROSS_PY_BASE}/${buildpy[$python_ver]}-xc
|
||||
CROSS_ENV_LN=${CROSS_PY_BASE_LN}/${buildpy[$python_ver]}-xc
|
||||
CROSS_ENV_PIP=${CROSS_ENV_LN}/cross/bin/pip
|
||||
|
||||
# Adding build python path as it is required to
|
||||
# configure the python for cross compilation
|
||||
PATH=${BUILD_PYBIN}:${OLD_PATH}
|
||||
export PATH
|
||||
|
||||
./configure --prefix=${TARGET_PYPATH} \
|
||||
--host=aarch64-unknown-linux-gnueabi \
|
||||
--build=x86_64-linux-gnu \
|
||||
--without-ensurepip \
|
||||
ac_cv_buggy_getaddrinfo=no \
|
||||
ac_cv_file__dev_ptmx=yes \
|
||||
ac_cv_file__dev_ptc=no \
|
||||
--enable-optimizations
|
||||
make -j32 install
|
||||
make install
|
||||
|
||||
# Create the necessary env and its link
|
||||
${BUILD_PIP} install --upgrade pip crossenv
|
||||
${BUILD_PYTHON} -m crossenv ${TARGET_PYTHON} ${CROSS_ENV}
|
||||
${LN} -s ${CROSS_ENV} ${CROSS_ENV_LN}
|
||||
${CROSS_ENV_PIP} install wheel
|
||||
rm -rf ${BUILD_DIR}
|
||||
done
|
Reference in New Issue
Block a user