Skip to content

Commit

Permalink
Strip before patching, otherwise the libraries may be corrupted
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsmith committed Oct 10, 2024
1 parent 38464a6 commit dda9ac7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 1 addition & 5 deletions android-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ fi

if [ -n "${PREFIX:-}" ]; then
abs_prefix=$(realpath $PREFIX)

# Use -idirafter so that package-specified -I directories take priority. For
# example, grpcio provides its own BoringSSL headers which must be used rather than
# our OpenSSL.
CFLAGS="$CFLAGS -idirafter $abs_prefix/include"
CFLAGS="$CFLAGS -I$abs_prefix/include"
LDFLAGS="$LDFLAGS -L$abs_prefix/lib"

export PKG_CONFIG="pkg-config --define-prefix"
Expand Down
5 changes: 5 additions & 0 deletions openssl/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ rm -r $prefix/usr
cd $prefix/lib
for name in crypto ssl; do
old_name=$(basename $(realpath lib$name.so)) # Follow symlinks.

# Strip before patching, otherwise the libraries may be corrupted:
# https://github.com/NixOS/patchelf/issues?q=is%3Aissue+strip+in%3Atitle
"$STRIP" "$old_name"

new_name="lib${name}_python.so"
if [ "$name" = "crypto" ]; then
crypto_old_name=$old_name
Expand Down
5 changes: 5 additions & 0 deletions sqlite/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ make install prefix=$prefix
cd $prefix/lib
for name in sqlite3; do
old_name=$(basename $(realpath lib$name.so)) # Follow symlinks.

# Strip before patching, otherwise the libraries may be corrupted:
# https://github.com/NixOS/patchelf/issues?q=is%3Aissue+strip+in%3Atitle
"$STRIP" "$old_name"

new_name="lib${name}_python.so"
mv "$old_name" "$new_name"
ln -s "$new_name" "$old_name"
Expand Down

0 comments on commit dda9ac7

Please sign in to comment.