summaryrefslogtreecommitdiff
path: root/CompileFlags.cmake
diff options
context:
space:
mode:
authorChuck Atkins <chuck.atkins@kitware.com>2019-02-27 11:31:57 -0600
committerChuck Atkins <chuck.atkins@kitware.com>2019-02-27 13:00:00 -0600
commit5c58a7e4d2eca9aa93518cc567e874fedcdf2a80 (patch)
tree7b57c9beb762a147c504576004ee8ea00ff7b5a0 /CompileFlags.cmake
parentb13a8441cd1338ac9f8352a4df54759a1b19088a (diff)
downloadcmake-5c58a7e4d2eca9aa93518cc567e874fedcdf2a80.tar.gz
ppc64: Work around TOC overflow with platform specific linker flags
Diffstat (limited to 'CompileFlags.cmake')
-rw-r--r--CompileFlags.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index 5d0e14493d..c8a039a848 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -44,6 +44,15 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc")
endif()
endif()
+# Workaround for TOC Overflow on ppc64
+if(CMAKE_SYSTEM_NAME STREQUAL "AIX" AND
+ CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-bbigtoc")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
+ CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-multi-toc")
+endif()
+
if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND
NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)