summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/AIX-XL.cmake
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@sap.com>2015-12-11 10:08:24 (GMT)
committerBrad King <brad.king@kitware.com>2015-12-11 14:21:47 (GMT)
commitf254276fc1a17de7cd5cfc016fd2137937830fca (patch)
tree16a9be779a054afe29666b659ba18a7e1dca65e7 /Modules/Platform/AIX-XL.cmake
parentfd7180f0c0c2554c31afda235469df986a109fe4 (diff)
downloadCMake-f254276fc1a17de7cd5cfc016fd2137937830fca.zip
CMake-f254276fc1a17de7cd5cfc016fd2137937830fca.tar.gz
CMake-f254276fc1a17de7cd5cfc016fd2137937830fca.tar.bz2
AIX,HP-UX: Fix RPATH handling when CMP0065 is set to NEW
The CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS setting has always been meant for flags needed to export symbols from executables for use by shared library plugins. Since commit v3.4.0-rc1~58^2~1 (CMP0065: Restrict the use of CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS, 2015-08-24) this is made explicit by using the flags only for executables with ENABLE_EXPORTS, guarded by CMP0065 for compatibility. On some platforms we were accidentally using this setting to pass other flags to the linker: * AIX: -bnoipath, -brtl * HP-UX: +s, +nodefaultrpath These flags are incorrectly dropped when CMP0065 is set to NEW. Fix this by moving the flags to more appropriate places for linking executables.
Diffstat (limited to 'Modules/Platform/AIX-XL.cmake')
-rw-r--r--Modules/Platform/AIX-XL.cmake12
1 files changed, 11 insertions, 1 deletions
diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake
index abf3855..5470441 100644
--- a/Modules/Platform/AIX-XL.cmake
+++ b/Modules/Platform/AIX-XL.cmake
@@ -18,11 +18,21 @@ if(__AIX_COMPILER_XL)
endif()
set(__AIX_COMPILER_XL 1)
+#
+# By default, runtime linking is enabled. All shared objects specified on the command line
+# will be listed, even if there are no symbols referenced, in the output file.
+set(CMAKE_SHARED_LINKER_FLAGS_INIT "-Wl,-brtl")
+set(CMAKE_MODULE_LINKER_FLAGS_INIT "-Wl,-brtl")
+set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,-brtl")
+
+
macro(__aix_compiler_xl lang)
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:")
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-G -Wl,-bnoipath") # -shared
- set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib
+ set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-bexpall")
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS " ")
set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ")
+
+ set(CMAKE_${lang}_LINK_FLAGS "-Wl,-bnoipath")
endmacro()