Skip to content

Commit 49ba397

Browse files
authored
[manylinux2014] Build a libcrypt.so.1 that suitable for grafting (#580)
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 67dda35 commit 49ba397

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

docker/build_scripts/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ cd ..
112112
rm -rf $SQLITE_AUTOCONF_VERSION*
113113
rm /usr/local/lib/libsqlite3.a
114114

115-
# Install libcrypt.so.2
115+
# Install libcrypt.so.1 and libcrypt.so.2
116116
build_libxcrypt "$LIBXCRYPT_DOWNLOAD_URL" "$LIBXCRYPT_VERSION" "$LIBXCRYPT_HASH"
117117

118118
# Compile the latest Python releases.

docker/build_scripts/build_utils.sh

+16-4
Original file line numberDiff line numberDiff line change
@@ -178,16 +178,28 @@ function build_libxcrypt {
178178
curl -fsSLO "$LIBXCRYPT_DOWNLOAD_URL"/v"$LIBXCRYPT_VERSION"
179179
check_sha256sum "v$LIBXCRYPT_VERSION" "$LIBXCRYPT_HASH"
180180
tar xfz "v$LIBXCRYPT_VERSION"
181-
(cd "libxcrypt-$LIBXCRYPT_VERSION" && ./autogen.sh && \
182-
do_standard_install \
181+
pushd "libxcrypt-$LIBXCRYPT_VERSION"
182+
./autogen.sh > /dev/null
183+
do_standard_install \
183184
--disable-obsolete-api \
184185
--enable-hashes=all \
185-
--disable-werror)
186+
--disable-werror
187+
# we also need libcrypt.so.1 with glibc compatibility for system libraries
188+
# c.f https://github.com/pypa/manylinux/issues/305#issuecomment-625902928
189+
make clean > /dev/null
190+
sed -r -i 's/XCRYPT_([0-9.])+/-/g;s/(%chain OW_CRYPT_1.0).*/\1/g' lib/libcrypt.map.in
191+
DESTDIR=$(pwd)/so.1 do_standard_install \
192+
--disable-xcrypt-compat-files \
193+
--enable-obsolete-api=glibc \
194+
--enable-hashes=all \
195+
--disable-werror
196+
cp -P ./so.1/usr/local/lib/libcrypt.so.1* /usr/local/lib/
197+
popd
186198
rm -rf "v$LIBXCRYPT_VERSION" "libxcrypt-$LIBXCRYPT_VERSION"
187199

188200
# Delete GLIBC version headers and libraries
189201
rm -rf /usr/include/crypt.h
190-
rm -rf /usr/lib64/libcrypt.a /usr/lib64/libcrypt.so
202+
rm -rf /usr/lib*/libcrypt.a /usr/lib*/libcrypt.so /usr/lib*/libcrypt.so.1
191203
}
192204

193205
function build_patchelf {

0 commit comments

Comments
 (0)