https://github.com/Kitware/CMake
Revision 0f150b69d3a01c3c5b4a96d10334eb2703ba237f authored by Brad King on 12 July 2019, 00:32:59 UTC, committed by Brad King on 15 July 2019, 17:27:16 UTC
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
1 parent a5bf4e7
History
Tip revision: 0f150b69d3a01c3c5b4a96d10334eb2703ba237f authored by Brad King on 12 July 2019, 00:32:59 UTC
AIX: Explicitly compute shared object exports for both XL and GNU
Tip revision: 0f150b6
File Mode Size
.github
Auxiliary
Help
Licenses
Modules
Packaging
Source
Templates
Tests
Utilities
.clang-format -rw-r--r-- 551 bytes
.clang-tidy -rw-r--r-- 986 bytes
.gitattributes -rw-r--r-- 1.1 KB
.gitignore -rw-r--r-- 132 bytes
.hooks-config -rw-r--r-- 418 bytes
CMakeCPack.cmake -rw-r--r-- 9.7 KB
CMakeCPackOptions.cmake.in -rw-r--r-- 11.9 KB
CMakeGraphVizOptions.cmake -rw-r--r-- 153 bytes
CMakeLists.txt -rw-r--r-- 31.1 KB
CMakeLogo.gif -rw-r--r-- 4.4 KB
CONTRIBUTING.rst -rw-r--r-- 3.0 KB
CTestConfig.cmake -rw-r--r-- 440 bytes
CTestCustom.cmake.in -rw-r--r-- 6.5 KB
CompileFlags.cmake -rw-r--r-- 4.0 KB
Copyright.txt -rw-r--r-- 5.2 KB
DartConfig.cmake -rw-r--r-- 374 bytes
README.rst -rw-r--r-- 3.9 KB
bootstrap -rwxr-xr-x 49.9 KB
cmake_uninstall.cmake.in -rw-r--r-- 790 bytes
configure -rwxr-xr-x 99 bytes
doxygen.config -rw-r--r-- 27.4 KB

README.rst

back to top