Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(PA-5645) Disable AIX runtime linking for curl on AIX
For reasons not entirely clear, if we provision an AIX host, install yum, install build dependencies and then build curl within the same ssh session, then the resulting curl executable will fail to run: # /opt/puppetlabs/puppet/bin/curl exec(): 0509-036 Cannot load program /opt/puppetlabs/puppet/bin/curl because of the following errors: 0509-150 Dependent module libcurl.a(libcurl.so.4) could not be loaded. 0509-022 Cannot load module libcurl.a(libcurl.so.4). 0509-026 System error: A file or directory in the path name does not exist. This occurs even though our libdir is first in the linker search path: # dumpbin -Hv /opt/puppetlabs/puppet/bin/curl ... ***Import File Strings*** INDEX PATH BASE MEMBER 0 /opt/puppetlabs/puppet/lib:/opt/puppetlabs/puppet/lib:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/../../..:/opt/freeware/lib:/usr/lib:/lib However, if you install yum and dependendencies in one ssh connection and then try to build curl in a second, it works. I think this has something to do with the way AIX caches shared libraries in memory. For example, `yum install` loads `libcurl.a` and it's still in memory when we build curl: # genkld | grep curl d15c9100 8a424 /opt/freeware/lib/libcurl.a[libcurl.so.4] It's possible to clear shared libraries whose reference counts are 0, using slibclean, but there's no guarantee that the library is unloaded. Disabling runtime linking (removing -brtl from LDFLAGS) seems to reliably work.
- Loading branch information