Skip to content

Commit c7a51ea

Browse files
committed
Simplify logic for rpath, the comma syntax is supported by all compilers
* From https://github.com/rbenv/ruby-build/pull/2496/files#r1915751424
1 parent 644d294 commit c7a51ea

File tree

2 files changed

+3
-39
lines changed

2 files changed

+3
-39
lines changed

bin/ruby-build

+1-6
Original file line numberDiff line numberDiff line change
@@ -1216,12 +1216,7 @@ build_package_openssl() {
12161216

12171217
# Help OpenSSL find its own shared libraries on Linux.
12181218
if [ "$(uname -s)" = "Linux" ]; then
1219-
# shellcheck disable=SC2031
1220-
if [ "$CC" = "clang" ] || "${CC:-cc}" --version 2>&1 | grep -wq clang; then
1221-
package_option openssl configure -Wl,-rpath,"$OPENSSL_PREFIX_PATH/lib"
1222-
else
1223-
package_option openssl configure -Wl,-rpath="$OPENSSL_PREFIX_PATH/lib"
1224-
fi
1219+
package_option openssl configure -Wl,-rpath,"$OPENSSL_PREFIX_PATH/lib"
12251220
fi
12261221

12271222
# Disable SSLv2 and Kerberos on older OpenSSL

test/build.bats

+2-33
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,7 @@ OUT
378378

379379
stub_repeated uname '-s : echo Linux'
380380
stub_repeated brew false
381-
stub cc \
382-
'-xc -E - : echo "OpenSSL 1.0.1a 1 Aug 2023"' \
383-
'--version : echo gcc'
381+
stub cc '-xc -E - : echo "OpenSSL 1.0.1a 1 Aug 2023"'
384382
stub openssl "version -d : echo 'OPENSSLDIR: \"${TMP}/ssl\"'"
385383
stub_make_install "install_sw"
386384
stub_make_install
@@ -399,7 +397,7 @@ DEF
399397
unstub make
400398

401399
assert_build_log <<OUT
402-
openssl-1.1.1w: [--prefix=${INSTALL_ROOT}/openssl,--openssldir=${INSTALL_ROOT}/openssl/ssl,--libdir=lib,zlib-dynamic,no-ssl3,shared,-Wl,-rpath=${INSTALL_ROOT}/openssl/lib]
400+
openssl-1.1.1w: [--prefix=${INSTALL_ROOT}/openssl,--openssldir=${INSTALL_ROOT}/openssl/ssl,--libdir=lib,zlib-dynamic,no-ssl3,shared,-Wl,-rpath,${INSTALL_ROOT}/openssl/lib]
403401
make -j 2
404402
make install_sw install_ssldirs
405403
ruby-3.2.0: [--prefix=$INSTALL_ROOT,--with-openssl-dir=$INSTALL_ROOT/openssl,--with-ext=openssl,psych,+] PKG_CONFIG_PATH=${TMP}/install/openssl/lib/pkgconfig
@@ -408,35 +406,6 @@ make install
408406
OUT
409407
}
410408

411-
@test "install OpenSSL with clang" {
412-
cached_tarball "openssl-1.1.1w" config
413-
414-
mkdir -p "${TMP}/ssl/certs"
415-
touch "${TMP}/ssl/cert.pem"
416-
417-
stub_repeated uname '-s : echo Linux'
418-
stub cc '--version : echo "Hello clang 1.2.3"'
419-
stub openssl "version -d : echo 'OPENSSLDIR: \"${TMP}/ssl\"'"
420-
stub_make_install "install_sw"
421-
422-
mkdir -p "$INSTALL_ROOT"/openssl/ssl # OPENSSLDIR
423-
run_inline_definition <<DEF
424-
install_package "openssl-1.1.1w" "https://www.openssl.org/source/openssl-1.1.1w.tar.gz" openssl
425-
DEF
426-
assert_success
427-
428-
unstub uname
429-
unstub cc
430-
# unstub openssl
431-
unstub make
432-
433-
assert_build_log <<OUT
434-
openssl-1.1.1w: [--prefix=${INSTALL_ROOT}/openssl,--openssldir=${INSTALL_ROOT}/openssl/ssl,--libdir=lib,zlib-dynamic,no-ssl3,shared,-Wl,-rpath,${INSTALL_ROOT}/openssl/lib]
435-
make -j 2
436-
make install_sw install_ssldirs
437-
OUT
438-
}
439-
440409
@test "skip bundling OpenSSL if custom openssl dir was specified" {
441410
cached_tarball "ruby-3.2.0" configure
442411

0 commit comments

Comments
 (0)