From 068c4047cf2a717002d7f098759ba450a6ad20db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Sat, 11 Jan 2025 15:15:26 +0100 Subject: [PATCH] Fix library lookup path in the vendored OpenSSL (#2493) * Fix library lookup path in the vendored OpenSSL When a vendored OpenSSL is needed for compiling Ruby, that OpenSSL installation ends up with its `bin/openssl` executable broken due to not finding "libssl.so" and "libcrypto.so" in the global load path for libraries. This doesn't seem to negatively affect the Ruby "openssl" extension, but is a broken OpenSSL install nevertheless. This change causes the `bin/openssl` executable and related shared libraries to be built with an "RPATH" pointing to the "lib" directory of the vendored OpenSSL. * fix test --- bin/ruby-build | 2 +- test/build.bats | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ruby-build b/bin/ruby-build index dce7d144da..2be2a610a4 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -1215,7 +1215,7 @@ build_package_openssl() { [[ "$1" != openssl-1.0.* ]] || nokerberos=1 # Compile a shared lib with zlib dynamically linked. - package_option openssl configure --openssldir="$OPENSSLDIR" --libdir="lib" zlib-dynamic no-ssl3 shared ${nokerberos:+no-ssl2 no-krb5} + package_option openssl configure --openssldir="$OPENSSLDIR" --libdir="lib" -Wl,-rpath="$OPENSSL_PREFIX_PATH/lib" zlib-dynamic no-ssl3 shared ${nokerberos:+no-ssl2 no-krb5} # Skip building OpenSSL docs, which is slow. local make_target="install_sw install_ssldirs" diff --git a/test/build.bats b/test/build.bats index 82be770ff0..a88f0bbdea 100755 --- a/test/build.bats +++ b/test/build.bats @@ -397,7 +397,7 @@ DEF unstub make assert_build_log <