Skip to content

AIX: Do not enable runtime linking by default anymore

Brad King requested to merge brad.king/cmake:aix-no-rtl into master

We've long created shared objects on AIX using the linker's -G option (also offered by the XL front-end). The -G option implies -brtl and enables runtime linking. This has been largely unnecessary because we provide all dependencies on the link line and both XL and GNU compilers offer builtin behavior to export symbols. Since !3556 (merged) we compute exports explicitly and consistently. Therefore runtime linking is no longer necessary for shared objects.

We've also long created executables on AIX using the linker's -brtl option to enable runtime linking in case they load plugins at runtime. Since !3556 (merged) and !3561 (merged) we now provide the linker enough information to fully resolve symbols in plugins up front. Therefore runtime linking is no longer necessary for executables.

Drop use of -G for creating shared objects and use the XL -qmkshrobj and GCC -shared options instead. Both invoke the linker with the -bM:SRE -bnoentry options to create a shared object without runtime linking enabled. Also drop use of -brtl for creating executables.

Issue: #19163 (closed)

Merge request reports