Skip to content

Commit

Permalink
[manylinux1] Build a libcrypt.so.1 that suitable for grafting (#582)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mayeut authored May 9, 2020
1 parent 9a0916b commit ada3d69
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docker/build_scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ do_standard_install
cd ..
rm -rf $SQLITE_AUTOCONF_VERSION*

# Install libcrypt.so.2
# Install libcrypt.so.1 and libcrypt.so.2
build_libxcrypt "$LIBXCRYPT_DOWNLOAD_URL" "$LIBXCRYPT_VERSION" "$LIBXCRYPT_HASH"

# Compile the latest Python releases.
Expand Down
22 changes: 17 additions & 5 deletions docker/build_scripts/build_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -273,16 +273,28 @@ function build_libxcrypt {
curl -fsSLO "$LIBXCRYPT_DOWNLOAD_URL"/v"$LIBXCRYPT_VERSION"
check_sha256sum "v$LIBXCRYPT_VERSION" "$LIBXCRYPT_HASH"
tar xfz "v$LIBXCRYPT_VERSION"
(cd "libxcrypt-$LIBXCRYPT_VERSION" && ./autogen.sh && \
do_standard_install \
pushd "libxcrypt-$LIBXCRYPT_VERSION"
./autogen.sh > /dev/null
do_standard_install \
--disable-obsolete-api \
--enable-hashes=all)
--enable-hashes=all \
--disable-werror
# we also need libcrypt.so.1 with glibc compatibility for system libraries
# c.f https://github.com/pypa/manylinux/issues/305#issuecomment-625902928
make clean > /dev/null
sed -r -i 's/XCRYPT_([0-9.])+/-/g;s/(%chain OW_CRYPT_1.0).*/\1/g' lib/libcrypt.map.in
DESTDIR=$(pwd)/so.1 do_standard_install \
--disable-xcrypt-compat-files \
--enable-obsolete-api=glibc \
--enable-hashes=all \
--disable-werror
cp -P ./so.1/usr/local/lib/libcrypt.so.1* /usr/local/lib/
popd
rm -rf "v$LIBXCRYPT_VERSION" "libxcrypt-$LIBXCRYPT_VERSION"

# Delete GLIBC version headers and libraries
rm -rf /usr/include/crypt.h
rm -rf /usr/lib/libcrypt.a /usr/lib/libcrypt.so
rm -rf /usr/lib64/libcrypt.a /usr/lib64/libcrypt.so
rm -rf /usr/lib*/libcrypt.a /usr/lib*/libcrypt.so /usr/lib*/libcrypt.so.1
}

function build_patchelf {
Expand Down

0 comments on commit ada3d69

Please sign in to comment.