diff options
author | William Marlow <william.marlow@lux01.co.uk> | 2022-07-12 06:41:25 (GMT) |
---|---|---|
committer | William Marlow <william.marlow@lux01.co.uk> | 2022-07-12 06:41:25 (GMT) |
commit | 74e3ac2b7e62f70440622db5c9a377a04f22697c (patch) | |
tree | ab6b3aed933e359596054db67fc03068b724442e /Modules/Platform/AIX-GNU.cmake | |
parent | 6212038992d2bfcce8f1ab23b82711376aa03cbf (diff) | |
download | CMake-74e3ac2b7e62f70440622db5c9a377a04f22697c.zip CMake-74e3ac2b7e62f70440622db5c9a377a04f22697c.tar.gz CMake-74e3ac2b7e62f70440622db5c9a377a04f22697c.tar.bz2 |
AIX: Export symbols from IBMClang IPA objects
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
Diffstat (limited to 'Modules/Platform/AIX-GNU.cmake')
-rw-r--r-- | Modules/Platform/AIX-GNU.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake index 5a532c7..a9aa8e0 100644 --- a/Modules/Platform/AIX-GNU.cmake +++ b/Modules/Platform/AIX-GNU.cmake @@ -23,11 +23,11 @@ macro(__aix_compiler_gnu lang) # Construct the export list ourselves to pass only the object files so # that we export only the symbols actually provided by the sources. set(CMAKE_${lang}_CREATE_SHARED_LIBRARY - "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/exports.exp <AIX_EXPORTS> <OBJECTS>" + "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/exports.exp -c <CMAKE_${lang}_COMPILER> <AIX_EXPORTS> <OBJECTS>" "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/exports.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" ) set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS - "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -l . <AIX_EXPORTS> <OBJECTS>" + "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -c <CMAKE_${lang}_COMPILER> -l . <AIX_EXPORTS> <OBJECTS>" "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") endmacro() |