summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/AIX
Commit message (Collapse)AuthorAgeFilesLines
* AIX: Consider tdata symbols in ExportImportListDavid Tenty2024-04-111-1/+1
| | | | | | | | | | Thread-local variables are put in the tdata section on AIX / XCOFF [1]. Unfortunately the ExportImportList script currently doesn't consider this section when looking for symbols to export. This results in linking failures in applications (such as LLVM) when building which expect these thread local variables to be exported from their shared libraries. [1]: https://www.ibm.com/docs/en/aix/7.3?topic=formats-xcoff-object-file-format
* AIX: Export symbols from IBMClang IPA objectsWilliam Marlow2022-07-121-12/+34
| | | | | | | | | | | | | | | When interprocedural analysis is enabled on the IBMClang family of compilers (via the `-flto` option) then the resulting object files contain LLVM IR rather than XCOFF objects[1]. ExportImportList needs to detect LLVM IR objects and use the `ibm-llvm-nm` tool that ships with the compiler to create the extract the defined symbols. Without this change, such objects result in an error message from `dump` and no symbols being exported from the object file. [1]: https://www.ibm.com/docs/en/openxl-c-and-cpp-aix/17.1.0?topic=compatibility-link-time-optimization-lto
* AIX: Add ExportImportList option to skip the object filesBrad King2020-01-311-14/+18
|
* AIX: Revise ExportImportList to build output more incrementallyBrad King2020-01-311-2/+5
| | | | This will allow more steps to be added.
* AIX: Create import library for executables with exportsBrad King2019-07-161-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On AIX, plugins meant to be loaded into executables via `dlopen` must be linked with access to a list of symbols exported from the executable in order to use them (when not using runtime linking). The AIX linker supports specifying this list as an "import file" passed on the command line either via the `-bI:...` option or (with a leading `#! .` line) as a normal input file like any other library file. The linker import file plays the same role on AIX as import libraries do on Windows. Teach CMake to enable its import library abstraction on AIX for executables with the `ENABLE_EXPORTS` target property set. Teach our internal `ExportImportList` script to optionally generate a leading `#! .` line at the top of the generated export/import list. Update our rule for linking an executable with exports to generate a public-facing "import library" implemented as an AIX linker import file. With this approach, our existing infrastructure for handling import libraries on Windows will now work for AIX linker import files too: * Plugins that link to their executable's symbols will be automatically linked using the import file on the command line. * The executable's import file will be (optionally) installed and exported for use in linking externally-built plugins. This will allow executables and their plugins to build even if we later turn off runtime linking. Issue: #19163
* AIX: Explicitly compute shared object exports for both XL and GNUBrad King2019-07-151-0/+48
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