summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2011-08-29 04:54:45 (GMT)
committerTodd Gamblin <tgamblin@llnl.gov>2011-08-29 05:08:11 (GMT)
commit5993891e8d3092375f4409e8d07f5138a1cb55be (patch)
tree6ee7c5a42bbb09397e5c22e1f300b329ab35935a /Modules/Platform
parentb17a6dd55b94179fb87f27255f918a7d82ea57e5 (diff)
downloadCMake-5993891e8d3092375f4409e8d07f5138a1cb55be.zip
CMake-5993891e8d3092375f4409e8d07f5138a1cb55be.tar.gz
CMake-5993891e8d3092375f4409e8d07f5138a1cb55be.tar.bz2
Fixed link bugs in BlueGeneP build.
- Build wasn't properly using -soname linker args, so installed libraries could depend on relative paths from the build directory. - Consolidated GNU linker args to one place in the BlueGeneP-base platform file, since ld is used by both XL and GNU toolchains on BlueGene.
Diffstat (limited to 'Modules/Platform')
-rw-r--r--Modules/Platform/BlueGeneP-base.cmake23
1 files changed, 13 insertions, 10 deletions
diff --git a/Modules/Platform/BlueGeneP-base.cmake b/Modules/Platform/BlueGeneP-base.cmake
index 2ca920f..926dbc0 100644
--- a/Modules/Platform/BlueGeneP-base.cmake
+++ b/Modules/Platform/BlueGeneP-base.cmake
@@ -85,20 +85,23 @@ set(CMAKE_DL_LIBS "dl")
macro(__BlueGeneP_set_dynamic_flags compiler_id lang)
if (${compiler_id} STREQUAL XL)
# Flags for XL compilers if we explicitly detected XL
- set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-qpic") # -pic
- set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-qmkshrobj -qnostaticlink") # -shared
- set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-rpath,") # -rpath
- set(BGP_${lang}_DYNAMIC_EXE_FLAGS "-qnostaticlink -qnostaticlink=libgcc")
+ set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-qpic")
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-qmkshrobj -qnostaticlink")
+ set(BGP_${lang}_DYNAMIC_EXE_FLAGS "-qnostaticlink -qnostaticlink=libgcc")
else()
# Assume flags for GNU compilers (if the ID is GNU *or* anything else).
- set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") # -pic
- set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") # -shared
- set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-rpath,") # -rpath
- set(BGP_${lang}_DYNAMIC_EXE_FLAGS "-dynamic")
+ set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
+ set(BGP_${lang}_DYNAMIC_EXE_FLAGS "-dynamic")
endif()
- set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "") # +s, flag for exe link to use shared lib
- set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") # : or empty
+ # Both toolchains use the GNU linker on BG/P, so these options are shared.
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-rpath,")
+ set(CMAKE_SHARED_LIBRARY_RPATH_LINK_${lang}_FLAG "-Wl,-rpath-link,")
+ set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,-soname,")
+ set(CMAKE_EXE_EXPORTS_${lang}_FLAG "-Wl,--export-dynamic")
+ set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "") # +s, flag for exe link to use shared lib
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") # : or empty
set(BGP_${lang}_DEFAULT_EXE_FLAGS
"<FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")