From 04f442f755fbfb317f6790e36686e05c4c906ba0 Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Tue, 4 Nov 2014 11:01:56 -0500 Subject: Workaround for short jump tables on PA-RISC. The PA-RISC architecture requires special options for GCC to prevent linker errors when libraries reach a certain size and / or complexity. See http://mraw.org/blog/2007/10/10/Linking_on_hppa and gcc documentation on -mlong-calls. --- CompileFlags.cmake | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'CompileFlags.cmake') diff --git a/CompileFlags.cmake b/CompileFlags.cmake index a4a4a78c98..7e9fb16c8c 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -65,6 +65,16 @@ if(CMAKE_SYSTEM_NAME MATCHES "HP-UX" AND CMAKE_CXX_COMPILER_ID MATCHES "HP") endif() endif() +# Workaround for short jump tables on PA-RISC +if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc") + if(CMAKE_COMPILER_IS_GNUC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-calls") + endif() + if(CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-calls") + endif() +endif() + # use the ansi CXX compile flag for building cmake if (CMAKE_ANSI_CXXFLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") @@ -74,10 +84,4 @@ if (CMAKE_ANSI_CFLAGS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") endif () -# avoid binutils problem with large binaries, e.g. when building CMake in debug mode -# See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50230 -if (CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_SYSTEM_PROCESSOR STREQUAL parisc) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unique=.text._*") -endif () - include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) -- cgit v1.2.1