summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'clang-cl-non-windows'Brad King2019-08-021-1/+1
|\ | | | | | | | | | | | | 863f7eb6d7 clang: Restore support for clang-cl on non-Windows hosts Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3634
| * clang: Restore support for clang-cl on non-Windows hostsBrad King2019-07-311-1/+1
| | | | | | | | | | | | | | | | | | The frontend variant detection logic added by commit 53fbe23f3f (clang: introduce CMAKE_<lang>_COMPILER_FRONTEND_VARIANT, 2019-02-20, v3.15.0-rc1~41^2~8) assumes that `clang-cl` only runs on a Windows host. It is also available on non-Windows hosts. Fix the condition. Fixes: #19544
| * Merge branch 'FindMPI-link-flags' into release-3.15Brad King2019-07-251-5/+2
| |\ | | | | | | | | | Merge-request: !3605
| * \ Merge branch 'backport-clang-gnulike-support' into release-3.15Brad King2019-07-241-0/+7
| |\ \ | | | | | | | | | | | | Merge-request: !3592
| * \ \ Merge branch 'InstallRequiredSystemLibraries-redist' into release-3.15Brad King2019-07-221-6/+14
| |\ \ \ | | | | | | | | | | | | | | | Merge-request: !3585
| * \ \ \ Merge branch 'backport-swift-improvements' into release-3.15Brad King2019-07-181-4/+19
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Merge-request: !3568
| | * | | | Swift: support SONAME on ELFish targetsSaleem Abdulrasool2019-07-181-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should enable the soname to be setup for ELF shared libraries. Failure to do so generates binaries with incorrect names which prevents loading.
| | * | | | Swift: support multithreaded compilationSaleem Abdulrasool2019-07-181-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Query the number of logical CPUs available to enable parallel compilation for Swift.
| | * | | | Swift: add rules for static linkingSaleem Abdulrasool2019-07-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Swift driver recently learnt how to generate static libraries using the `-static` flag. This enables us to generate proper static libraries with dependency tracking with Swift as well.
| | * | | | Support per-language library link flagsSaleem Abdulrasool2019-07-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the behaviour of the generators to use a per-language library search path flag. This is needed for multi-language projects with different compilers (e.g. cl + gfortran). Since the adjusted variable has been part of the user settings, we control this based on a policy. Fixes: #19307
* | | | | | Merge topic 'ExternalProject-avoid-extra-checkout'Brad King2019-07-311-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 627fc5b44f ExternalProject: Avoid unnecessary checkout on clone Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3626
| * | | | | | ExternalProject: Avoid unnecessary checkout on cloneTetragramm2019-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clone step checks out the cloned branch but is always followed by an explicit checkout of the desired `GIT_TAG`. Tell `git clone` not to check out.
* | | | | | | FindPythonInterp: Document lack of version filtering for plain `python`Brad King2019-07-301-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also drop the `CMakeOnly.MajorVersionSelection-PythonInterp_2` test because some environments now have a plain `python` executable for Python 3. Fixes: #19536
* | | | | | | Merge topic 'find_more_binutils'Brad King2019-07-301-16/+26
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 993fe2b4af CMakeFindBinUtils: add some more binutils 5412d63714 CMakeFindBinUtils: add missing llvm alternatives 3a82ef78eb CMakeFindBinUtils: Rename and unset variables for additional names Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3584
| * | | | | | CMakeFindBinUtils: add some more binutilsNorbert Lange2019-07-231-1/+7
| | | | | | |
| * | | | | | CMakeFindBinUtils: add missing llvm alternativesNorbert Lange2019-07-231-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LLVM 8.0 already ships with alternatives for all current Binutils. Enable them.
| * | | | | | CMakeFindBinUtils: Rename and unset variables for additional namesNorbert Lange2019-07-231-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | use the name pattern `_CMAKE_ADDITIONAL_<PROGRAM_NAME>_NAMES`, and unset those variables at the end of the function
* | | | | | | Merge topic 'CheckCXXSymbolExists-c++-syntax'Brad King2019-07-292-2/+34
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 72fcadb007 CheckCXXSymbolExists: Make C++-syntax symbols work on more compilers Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3545
| * | | | | | | CheckCXXSymbolExists: Make C++-syntax symbols work on more compilersHong Xu2019-07-262-2/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some compilers the syntax `#ifndef std::fopen` will always lead to compilation error. Avoid generating it in the check.
* | | | | | | | Android: Use unified toolchain in NDK r19+Brad King2019-07-266-3/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NDK build system now uses only a single toolchain in <ndk>/toolchains/llvm/prebuilt/<host> Its compilers are always `bin/{clang,clang++}` and its binutils are always `bin/<triple>-*`. It is a standalone toolchain: * The Anrdoid API level is specified at the end of `--target=`. * The standard library may be specified via `-stdlib=`. * No need to pass system includes or libraries explicitly. * No need to pass `--sysroot` or `-gcc-toolchain`. Teach CMake to recognize NDK versions that have a unified toolchain with its own sysroot and use the above approach. Fixes: #18739
* | | | | | | | Android: Re-order system initialization to select sysroot lastBrad King2019-07-261-2/+2
| | | | | | | |
* | | | | | | | Android: Clarify name of internal variable for arch tripleBrad King2019-07-262-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The triple applies to more than just header locations.
* | | | | | | | Android: Select NDK host tag while determining systemBrad King2019-07-264-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The host tag is tied to the host platform and does not depend on any specific language or compiler.
* | | | | | | | Merge topic 'ep_support_no_submodule_init'Kyle Edwards2019-07-261-18/+50
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d6be117ca0 ExternalProject: Support not initializing any submodules Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3579
| * | | | | | | | ExternalProject: Support not initializing any submodulesRobert Maynard2019-07-241-18/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #15592
* | | | | | | | | Merge topic 'FindMPI-link-flags'Brad King2019-07-261-3/+1
|\ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cf04da7e70 FindMPI: make sure computed link flags are not de-duplicated Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: Ben Boeckel <ben.boeckel@kitware.com> Tested-by: Robert Maynard <robert.maynard@kitware.com> Acked-by: Axel Huebl <axel.huebl@plasma.ninja> Merge-request: !3605
| * | | | | | | | FindMPI: make sure computed link flags are not de-duplicatedRobert Maynard2019-07-251-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit f7eaa342de (FindMPI: Store imported target link flags as a list instead of a string, 2019-06-14, v3.15.0-rc2~2^2) we used `separate_arguments` to parse the extracted link flags and add them to `INTERFACE_LINK_LIBRARIES`. That property is not meant for link flags and CMake may de-duplicate them. This is particularly problematic for flags like `-Wl,-rpath -Wl,/path1 -Wl,-rpath -Wl,/path2`. In commit 39c572c9c9 (FindMPI: Updated to use INTERFACE_LINK_OPTIONS, 2019-06-24) we moved the parsed flags over to `INTERFACE_LINK_OPTIONS`, but that may still perform de-duplication. Avoid the parsing and de-duplication of flags by passing the original string via `SHELL:` instead. Fixes: #19516
* | | | | | | | | Merge branch 'backport-clang-gnulike-support' into clang-gnulike-supportBrad King2019-07-241-0/+7
|\ \ \ \ \ \ \ \ \ | |_|/ / / / / / / |/| | | | | | | / | | |_|_|_|_|_|/ | |/| | | | | |
| * | | | | | | Clang: For MSVC ABI do not use modes older than C++14Brad King2019-07-241-0/+7
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit d44c0db0b2 (clang: setup correct configuration in gnu mode, 2019-02-20, v3.15.0-rc1~41^2~5) we support the GNU-like Clang that targets the MSVC ABI. However, Clang cannot compile with the MSVC standard library unless it runs in a mode aware of C++14 (since MSVC itself does not even have a lower mode). When `CMAKE_CXX_STANDARD` is set to 98 or 11, use C++14 anyway. Since Clang's default mode is aware of C++14, another option is to not add any flags for 98 or 11. However, if a future Clang version ever defaults to a higher C++ standard, setting the standard to 98 or 11 should at least not use a mode higher than 14. Also revert test updates from commit 4819ff9647 (Tests: fix failures with gnu mode clang on windows, 2019-03-21, v3.15.0-rc1~41^2~3) that were meant to work around the standard selection problem. Fixes: #19496
* | | | | | | Merge topic 'InstallRequiredSystemLibraries-redist'Brad King2019-07-231-6/+14
|\ \ \ \ \ \ \ | | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 13c3ec545b IRSL: Fix discovery of VS 2019 v141 toolset redistributables 0484165da0 IRSL: Fix typo in v143 toolset version check Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3585
| * | | | | | IRSL: Fix discovery of VS 2019 v141 toolset redistributablesJames Butler2019-07-221-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since VS 2019, the v141 toolset redistributables can be found in either the VS 2019 or VS 2017 install directory. Update the logic to search multiple versions of VS. Fixes: #19488
| * | | | | | IRSL: Fix typo in v143 toolset version checkJames Butler2019-07-221-2/+2
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the toolset v143 check from commit 33ee779330 (IRSL: Fix discovery of VS 2019 v142 toolset redistributables, 2019-04-03, v3.14.2~6^2) to check the correct variable.
* | | | | | Merge topic 'cpack-install-scripts'Craig Scott2019-07-221-1/+15
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5f96601675 CPack: Introduce CPACK_INSTALL_SCRIPTS variable Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3531
| * | | | | CPack: Introduce CPACK_INSTALL_SCRIPTS variableAlex Turbov2019-07-211-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The singular name `CPACK_INSTALL_SCRIPT` has existed but was not linked from the CPack documentation. Also, it supported multiple values and should have had a plural name. Add a plural-named alternative now. If both `CPACK_INSTALL_SCRIPTS` and `CPACK_INSTALL_SCRIPT` are set then ignore the latter with a warning. Signed-off-by: Alex Turbov <i.zaufi@gmail.com>
* | | | | | Merge topic 'swift-deduplicate'Brad King2019-07-191-16/+10
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 151ef7cef4 Swift: refactor rule construction to reduce duplication Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3551
| * | | | | | Swift: refactor rule construction to reduce duplicationSaleem Abdulrasool2019-07-171-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the placeholder expansion to avoid constructing the `-target` option by hand if specified. This reduces duplication and simplifies the rules.
* | | | | | | Merge topic 'FindProtobuf-DLLs'Brad King2019-07-191-0/+15
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3bbd85d5ff FindProtobuf: Fix usage of protobuf dynamic libraries on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3555
| * | | | | | | FindProtobuf: Fix usage of protobuf dynamic libraries on Windowsgnaggnoyil2019-07-181-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define `PROTOBUF_USE_DLLS` on Windows when linking against dynamic protobuf libraries so that we import symbols from them. We use the condition `MSVC` to enable this because that is what the upstream buildsystem uses.
* | | | | | | | Fix repeated word in FindVulkan.cmakeNeroBurner2019-07-181-1/+1
| | | | | | | |
* | | | | | | | Merge topic 'FindPython-interpreter-crosscompiling'Brad King2019-07-181-11/+10
|\ \ \ \ \ \ \ \ | | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 696d0f9caf FindPython: ensure interpreter is founded when cross-compiling Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3564
| * | | | | | | FindPython: ensure interpreter is founded when cross-compilingMarc Chevrier2019-07-181-11/+10
| | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | Fixes: #19473
| * | | | | | Merge branch 'FindBISON-CMP0088-SourcePath' into release-3.15Brad King2019-07-121-3/+9
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Merge-request: !3549
| * \ \ \ \ \ \ Merge branch 'fortran-submodule-cray' into release-3.15Brad King2019-07-111-0/+2
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge-request: !3504
| * \ \ \ \ \ \ \ Merge branch 'implicit-includes-cray-hlist' into release-3.15Brad King2019-07-101-2/+2
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge-request: !3532
| * \ \ \ \ \ \ \ \ Merge branch 'iar-riscv' into release-3.15Brad King2019-07-097-3/+20
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge-request: !3510
* | | | | | | | | | | AIX: Do not enable runtime linking by default anymoreBrad King2019-07-172-14/+2
| |_|_|_|_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 commit 0f150b69d3 (AIX: Explicitly compute shared object exports for both XL and GNU, 2019-07-11) 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 commit 9f5c2040bf (AIX: Explicitly compute executable exports for both XL and GNU, 2019-07-12) and commit 2fa920c0cd (AIX: Create import library for executables with exports, 2019-07-16) 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
* | | | | | | | | | AIX: Create import library for executables with exportsBrad King2019-07-164-5/+12
| |_|_|_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | | | Merge topic 'aix-explicit-exports'Brad King2019-07-169-30/+71
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c2c3d22504 Tests: Drop RunCMake workaround for AIX ld warnings about GNU atexit 9f5c2040bf AIX: Explicitly compute executable exports for both XL and GNU 0f150b69d3 AIX: Explicitly compute shared object exports for both XL and GNU a5bf4e7921 AIX: Drop redundant -brtl flags 9cb5f040d7 XL: De-duplicate shared object creation flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3556
| * | | | | | | | | AIX: Explicitly compute executable exports for both XL and GNUBrad King2019-07-152-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On AIX, symbols in executables must be exported in order to be visible to modules (plugins) they load via `dlopen`. Prior to policy `CMP0065`, CMake linked all executables with flags to export symbols, but the NEW behavior for that policy is to do so only for executables that have the `ENABLE_EXPORTS` target property set. In both cases, CMake has always used the AIX linker option `-bexpall` option to export symbols from executables. This has worked fairly well with the XL compiler, but with the GNU compiler it works only for C ABI symbols. The reason is that `-bexpall` does not export symbols starting in `_` but the GNU C++ ABI mangles all symbols with a leading `_`. Therefore we have only supported C ABI plugins with the GNU compiler on AIX. Some projects have tried to work around this by replacing `-bexpall` with `-bexpfull`, but the latter often exports symbols that we do not want exported. Avoid using `-bexpall` for executables by instead using by our own internal `ExportImportList` script to compute symbol export lists from the object files to be linked into an executable. Pass the explicitly computed export list to the AIX linker's `-bE:...` option. We already do this for shared object exports. Issue: #19163
| * | | | | | | | | AIX: Explicitly compute shared object exports for both XL and GNUBrad King2019-07-153-20/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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