Skip to content

Commit aa23514

Browse files
committed
perl-modules: link Crypt::SSLeay against our custom-built OpenSSL
$(location @openssl//:gen_dir) returns a path relative to the Bazel execroot. build_module.pl chdirs into the extracted tarball directory before invoking Makefile.PL, making the relative path dangle — the linker silently fell back to system libssl.so.1.1. Fix: prefix the openssl path with $$PWD in the genrule cmd so it is absolute and survives the chdir. Also pass OPENSSL_PREFIX, -I <prefix>/include (CCFLAGS), and correct -L <prefix>/lib (LDDLFLAGS) so Crypt::SSLeay's Makefile.PL discovers our OpenSSL headers and libraries rather than the system ones. CMK-33658 Change-Id: I8e31007d3e37f996a04caff37e44c4cf6840d0b0 (cherry picked from commit 0cf0d40) (cherry picked from commit e232cf1)
1 parent ded4cd9 commit aa23514

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

omd/packages/perl-modules/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ genrule(
6666
export PERL5LIB="$$(dirname $(location @omd_packages//omd/packages/perl-modules:lib/BuildHelper.pm)):$$PWD/perl-modules/lib/perl5:$$PWD/Crypt-SSLeay-0.72"
6767
FORCE=1 $(location @omd_packages//omd/packages/perl-modules:build_module.pl) -p $$PWD/perl-modules $$(cat $(location perl_module_list_1.txt));
6868
$(location @omd_packages//omd/packages/perl-modules:build_module.pl) -p $$PWD/perl-modules $$(cat $(location perl_module_list_2.txt));
69-
$(location @omd_packages//omd/packages/perl-modules:build_module.pl) -p $$PWD/perl-modules -L $(location @openssl//:gen_dir) $(locations @Crypt-SSLeay//:Crypt-SSLeay-0.72.tar.gz);
69+
$(location @omd_packages//omd/packages/perl-modules:build_module.pl) -p $$PWD/perl-modules -L $$PWD/$(location @openssl//:gen_dir) $(locations @Crypt-SSLeay//:Crypt-SSLeay-0.72.tar.gz);
7070
7171
mv perl-modules perl-modules-install
7272
mkdir -p perl-modules/lib/perl5 perl-modules/bin

omd/packages/perl-modules/lib/BuildHelper.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ sub install_module {
430430
#
431431
# \\\$\\\$ is required as $$ is the syntax for the Makefile.
432432
# Also we need to escape it for both perl and the shell.
433-
$makefile_opts = "$makefile_opts FORCE=1 CCFLAGS=\"$Config::Config{ccflags} -Wno-implicit-function-declaration -Wno-int-conversion\" LDDLFLAGS=\"-L $OPENSSL $Config::Config{lddlflags} -Wl,-rpath,'\\\$\\\$ORIGIN/../../../../../../../../lib'\" ";
433+
$makefile_opts = "$makefile_opts FORCE=1 OPENSSL_PREFIX=$OPENSSL CCFLAGS=\"$Config::Config{ccflags} -Wno-implicit-function-declaration -Wno-int-conversion -I $OPENSSL/include\" LDDLFLAGS=\"-L $OPENSSL/lib $Config::Config{lddlflags}\" ";
434434
}
435435
if($modname eq 'List::MoreUtils') {
436436
system("sed -i -e '/url\\s*=>.*github/d' -e '/perl.*=>\\s*\\\$^V/d' Makefile.PL");

0 commit comments

Comments
 (0)