Skip to content

Commit

Permalink
Move patch elf later
Browse files Browse the repository at this point in the history
  • Loading branch information
arcivanov committed Sep 9, 2024
1 parent 01552d1 commit f1917ce
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions patches/0-patch.patch
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ index d59ae7b..b76ec6d 100755
docker push ${TAG}:${BUILD_ID2}
docker push ${TAG}:latest
diff --git a/docker/build_scripts/build-cpython.sh b/docker/build_scripts/build-cpython.sh
index ea7485a..dd046f6 100755
index ea7485a..8749ba7 100755
--- a/docker/build_scripts/build-cpython.sh
+++ b/docker/build_scripts/build-cpython.sh
@@ -35,11 +35,16 @@ mkdir -p ${PREFIX}/lib
Expand All @@ -64,16 +64,16 @@ index ea7485a..dd046f6 100755
if [ "${CPYTHON_VERSION}" == "3.6.15" ]; then
# https://github.com/python/cpython/issues/89863
# gcc-12+ uses these 2 flags in -O2 but they were only enabled in -O3 with gcc-11
@@ -66,6 +71,9 @@ fi
LDFLAGS_NODIST="${MANYLINUX_LDFLAGS}" \
--prefix=${PREFIX} ${CONFIGURE_ARGS} > /dev/null
make > /dev/null
+if [ "${2:-}" == "shared" -o "${3:-}" == "shared" ]; then
+ patchelf --force-rpath --set-rpath '$ORIGIN/../lib' /Python-${CPYTHON_VERSION}/python
+fi
@@ -69,6 +74,9 @@ make > /dev/null
make install > /dev/null
popd
rm -rf Python-${CPYTHON_VERSION} Python-${CPYTHON_VERSION}.tgz Python-${CPYTHON_VERSION}.tgz.asc
+if [ "${2:-}" == "shared" -o "${3:-}" == "shared" ]; then
+ patchelf --force-rpath --set-rpath '$ORIGIN/../lib' ${PREFIX}/bin/python3
+fi

if [ "${OPENSSL_PREFIX}" != "" ]; then
rm -rf ${OPENSSL_PREFIX}/bin ${OPENSSL_PREFIX}/include ${OPENSSL_PREFIX}/lib/pkgconfig ${OPENSSL_PREFIX}/lib/*.so
@@ -79,3 +87,6 @@ clean_pyc ${PREFIX}

# Strip ELF files found in ${PREFIX}
Expand Down Expand Up @@ -121,7 +121,7 @@ index 94bb921..3af3ff4 100755
+ ln -s ${PREFIX}/bin/python /usr/local/bin/${PY_IMPL}${PY_VER}${PY_GIL}
+fi
diff --git a/docker/build_scripts/install-runtime-packages.sh b/docker/build_scripts/install-runtime-packages.sh
index 402021a..9218689 100755
index 402021a..61f0edc 100755
--- a/docker/build_scripts/install-runtime-packages.sh
+++ b/docker/build_scripts/install-runtime-packages.sh
@@ -56,7 +56,7 @@ else
Expand Down

0 comments on commit f1917ce

Please sign in to comment.