summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-02-28 16:45:09 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-02-28 16:46:10 (GMT)
commitd84fb10034fc7371474c3d1413e78c317f743833 (patch)
tree8aa01f509d36f864cdfa81c9edc4905476d833d8
parent95222584ee2a2ef7874c4eaf9cb20733fa347ad8 (diff)
parent5c58a7e4d2eca9aa93518cc567e874fedcdf2a80 (diff)
downloadCMake-d84fb10034fc7371474c3d1413e78c317f743833.zip
CMake-d84fb10034fc7371474c3d1413e78c317f743833.tar.gz
CMake-d84fb10034fc7371474c3d1413e78c317f743833.tar.bz2
Merge topic 'ppc64-toc-overflow'
5c58a7e4d2 ppc64: Work around TOC overflow with platform specific linker flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3038
-rw-r--r--CompileFlags.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index 5d0e144..c8a039a 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)