Skip to content

AIX: Compute shared object and executable exports explicitly

Brad King requested to merge brad.king/cmake:aix-explicit-exports into master

On AIX, symbols in shared objects must be exported in order to be visible to dependents. Previously we've depended on CreateExportList for XL and on the GNU compiler's builtin collect2 behavior to generate export lists. Introduce our own ExportImportList script to behave consistently with both compilers. Start with a basic implementation; we can extend it later as needed.

Similarly, symbols in executables must be exported to be visible to modules (plugins) they load via dlopen. Previously we've relied on -bexpall but this has various limitations (especially not exporting symbols starting in _ excludes all GNU C++ ABI symbols). Replace it with use of our ExportImportList script to export symbols from executables with ENABLE_EXPORTS set.

See individual commit messages for further details.

For now we leave runtime linking enabled. Future work may make that optional now that we compute proper exports.

Issue: #19163 (closed)

Merge request reports