From 3a757e5cc892edd6430c4e8d9798fcfa4c1caab6 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Thu, 29 Jun 2023 17:22:28 -0700 Subject: [PATCH] (PA-4871) Add our libdir to the runtime linker search path When the runtime linker loads executables, it uses a search path in the executable to find library dependencies. On most platforms this is done via -rpath, but on AIX it's -R. The search path is embedded in the executable and can be seen using: # dump -H /opt/puppetlabs/puppet/bin/openssl ... ***Import File Strings*** INDEX PATH BASE MEMBER 0 /opt/puppetlabs/puppet/lib:/usr/lib:/lib --- configs/components/openssl-3.0.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configs/components/openssl-3.0.rb b/configs/components/openssl-3.0.rb index 94548e251..7ee4733c9 100644 --- a/configs/components/openssl-3.0.rb +++ b/configs/components/openssl-3.0.rb @@ -53,8 +53,9 @@ pkg.environment 'CC', '/opt/freeware/bin/gcc' cflags = "#{settings[:cflags]} -static-libgcc" - # see https://github.com/openssl/openssl/issues/18007 - ldflags = "#{settings[:ldflags]} -latomic -lm" + # see https://github.com/openssl/openssl/issues/18007 about -latomic + # see https://www.ibm.com/docs/en/aix/7.2?topic=l-ld-command about -R, which is equivalent to -rpath + ldflags = "#{settings[:ldflags]} -Wl,-R#{settings[:libdir]} -latomic -lm" target = 'aix-gcc' # elsif platform.is_solaris? # pkg.environment 'PATH', '/opt/pl-build-tools/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin'