Skip to content

Commit ada3d69

Browse files
authored
[manylinux1] Build a libcrypt.so.1 that suitable for grafting (#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 9a0916b commit ada3d69

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

docker/build_scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ do_standard_install
120120
cd ..
121121
rm -rf $SQLITE_AUTOCONF_VERSION*
122122

123-
# Install libcrypt.so.2
123+
# Install libcrypt.so.1 and libcrypt.so.2
124124
build_libxcrypt "$LIBXCRYPT_DOWNLOAD_URL" "$LIBXCRYPT_VERSION" "$LIBXCRYPT_HASH"
125125

126126
# Compile the latest Python releases.

docker/build_scripts/build_utils.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,28 @@ function build_libxcrypt {
273273
curl -fsSLO "$LIBXCRYPT_DOWNLOAD_URL"/v"$LIBXCRYPT_VERSION"
274274
check_sha256sum "v$LIBXCRYPT_VERSION" "$LIBXCRYPT_HASH"
275275
tar xfz "v$LIBXCRYPT_VERSION"
276-
(cd "libxcrypt-$LIBXCRYPT_VERSION" && ./autogen.sh && \
277-
do_standard_install \
276+
pushd "libxcrypt-$LIBXCRYPT_VERSION"
277+
./autogen.sh > /dev/null
278+
do_standard_install \
278279
--disable-obsolete-api \
279-
--enable-hashes=all)
280+
--enable-hashes=all \
281+
--disable-werror
282+
# we also need libcrypt.so.1 with glibc compatibility for system libraries
283+
# c.f https://github.com/pypa/manylinux/issues/305#issuecomment-625902928
284+
make clean > /dev/null
285+
sed -r -i 's/XCRYPT_([0-9.])+/-/g;s/(%chain OW_CRYPT_1.0).*/\1/g' lib/libcrypt.map.in
286+
DESTDIR=$(pwd)/so.1 do_standard_install \
287+
--disable-xcrypt-compat-files \
288+
--enable-obsolete-api=glibc \
289+
--enable-hashes=all \
290+
--disable-werror
291+
cp -P ./so.1/usr/local/lib/libcrypt.so.1* /usr/local/lib/
292+
popd
280293
rm -rf "v$LIBXCRYPT_VERSION" "libxcrypt-$LIBXCRYPT_VERSION"
281294

282295
# Delete GLIBC version headers and libraries
283296
rm -rf /usr/include/crypt.h
284-
rm -rf /usr/lib/libcrypt.a /usr/lib/libcrypt.so
285-
rm -rf /usr/lib64/libcrypt.a /usr/lib64/libcrypt.so
297+
rm -rf /usr/lib*/libcrypt.a /usr/lib*/libcrypt.so /usr/lib*/libcrypt.so.1
286298
}
287299

288300
function build_patchelf {

0 commit comments

Comments
 (0)