Skip to content

Commit 155d8b2

Browse files
mayeutrdb
authored andcommitted
[manylinux1] Build a libcrypt.so.1 that suitable for grafting (pypa#582)
With libcrypt.so.1 being removed from the whitelist of auditwheel, system libcrypt.so.1 cannot be grafted as it relies on GLIBC_PRIVATE symbols. This rebuilds a suitable replacement for libcrypt.so.1
1 parent 08c172a commit 155d8b2

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

docker/build_scripts/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ do_standard_install
114114
cd ..
115115
rm -rf $SQLITE_AUTOCONF_VERSION*
116116

117-
# Install libcrypt.so.2
117+
# Install libcrypt.so.1 and libcrypt.so.2
118118
build_libxcrypt "$LIBXCRYPT_DOWNLOAD_URL" "$LIBXCRYPT_VERSION" "$LIBXCRYPT_HASH"
119119

120120
# Compile the latest Python releases.

docker/build_scripts/build_utils.sh

+17-5
Original file line numberDiff line numberDiff line change
@@ -260,16 +260,28 @@ function build_libxcrypt {
260260
curl -fsSLO "$LIBXCRYPT_DOWNLOAD_URL"/v"$LIBXCRYPT_VERSION"
261261
check_sha256sum "v$LIBXCRYPT_VERSION" "$LIBXCRYPT_HASH"
262262
tar xfz "v$LIBXCRYPT_VERSION"
263-
(cd "libxcrypt-$LIBXCRYPT_VERSION" && ./bootstrap && \
264-
do_standard_install \
263+
pushd "libxcrypt-$LIBXCRYPT_VERSION"
264+
./autogen.sh > /dev/null
265+
do_standard_install \
265266
--disable-obsolete-api \
266-
--enable-hashes=all)
267+
--enable-hashes=all \
268+
--disable-werror
269+
# we also need libcrypt.so.1 with glibc compatibility for system libraries
270+
# c.f https://github.com/pypa/manylinux/issues/305#issuecomment-625902928
271+
make clean > /dev/null
272+
sed -r -i 's/XCRYPT_([0-9.])+/-/g;s/(%chain OW_CRYPT_1.0).*/\1/g' lib/libcrypt.map.in
273+
DESTDIR=$(pwd)/so.1 do_standard_install \
274+
--disable-xcrypt-compat-files \
275+
--enable-obsolete-api=glibc \
276+
--enable-hashes=all \
277+
--disable-werror
278+
cp -P ./so.1/usr/local/lib/libcrypt.so.1* /usr/local/lib/
279+
popd
267280
rm -rf "v$LIBXCRYPT_VERSION" "libxcrypt-$LIBXCRYPT_VERSION"
268281

269282
# Delete GLIBC version headers and libraries
270283
rm -rf /usr/include/crypt.h
271-
rm -rf /usr/lib/libcrypt.a /usr/lib/libcrypt.so
272-
rm -rf /usr/lib64/libcrypt.a /usr/lib64/libcrypt.so
284+
rm -rf /usr/lib*/libcrypt.a /usr/lib*/libcrypt.so /usr/lib*/libcrypt.so.1
273285
}
274286

275287
function build_patchelf {

0 commit comments

Comments
 (0)