diff options
author | Brad King <brad.king@kitware.com> | 2019-07-12 00:32:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-07-15 17:27:16 (GMT) |
commit | 0f150b69d3a01c3c5b4a96d10334eb2703ba237f (patch) | |
tree | 1b87dca2d9b23894cc51cf127ef7306134c43fad /CMakeCPackOptions.cmake.in | |
parent | a5bf4e7921e5ac1abbe8fd71a597a8b37e6f08d2 (diff) | |
download | CMake-0f150b69d3a01c3c5b4a96d10334eb2703ba237f.zip CMake-0f150b69d3a01c3c5b4a96d10334eb2703ba237f.tar.gz CMake-0f150b69d3a01c3c5b4a96d10334eb2703ba237f.tar.bz2 |
AIX: Explicitly compute shared object exports for both XL and GNU
On AIX, symbols in shared objects must be exported in order to be
visible to dependents (similar to Windows). The AIX linker provides a
`-bE:...` option to specify a file listing symbols to be exported.
Compilers offer some features to help:
* When the XL compiler is invoked with its `-qmkshrobj`/`-G` options for
creating shared objects (without/with runtime linking), it recognizes
when no explicit `-bE:...` linker option is specified and runs a
`CreateExportList` tool provided with the compiler to compute one from
the object files. Since commit d468a2c2cb (XL: Avoid copying archives
into shared libraries that link them, 2011-04-07, v2.8.5~153^2) CMake
runs `CreateExportList` explicitly to ensure it only looks at the object
files and not any library files.
* When the GNU compiler is invoked with its `-shared` option for creating
shared objects, its internal `collect2` tool recognizes when no explicit
`-bE:...` linker option is specified and computes one itself from the
object files. However, it sometimes includes extra symbols such as
`.__init_aix_libgcc_cxa_atexit`.
Introduce our own internal `ExportImportList` script to compute symbol
export lists from object files. Use a basic implementation for now: it
can be extended as needed later. Update our shared library creation
rules to run the script explicitly for both the XL and GNU compilers.
Issue: #19163
Diffstat (limited to 'CMakeCPackOptions.cmake.in')
0 files changed, 0 insertions, 0 deletions