summaryrefslogtreecommitdiff
path: root/CompileFlags.cmake
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2012-10-28 23:23:29 +0100
committerBrad King <brad.king@kitware.com>2012-10-31 16:28:51 -0400
commite496c5402193ee26fa245c1970f87d795f56bdab (patch)
tree2ea5b8a2cc95793d0d98001e834bd179c77fbefe /CompileFlags.cmake
parentabe4edfad3c6e8c2f2e9c08117507089790b303b (diff)
downloadcmake-e496c5402193ee26fa245c1970f87d795f56bdab.tar.gz
Linux/PA-RISC: Link with --unique=.text.* to help binutils
There is a binutils bug that leads to errors like this: /usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.6.3/../../../../hppa2.0-unknown-linux-gnu/bin/ld: libCMakeLib.a(cmTarget.cxx.o)(.text+0x12084): cannot reach 00001d28__ZNSspLEPKc@@GLIBCXX_3.4+0, recompile with -ffunction-sections /usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.6.3/../../../../hppa2.0-unknown-linux-gnu/bin/ld: libCMakeLib.a(cmTarget.cxx.o)(.text+0x12084): cannot handle R_PARISC_PCREL17F for std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char const*)@@GLIBCXX_3.4 /usr/lib/gcc/hppa2.0-unknown-linux-gnu/4.6.3/../../../../hppa2.0-unknown-linux-gnu/bin/ld: final link failed: Bad value Until someone finds out what needs to be fixed in binutils this allows anyone to compile a working CMake even in debug mode.
Diffstat (limited to 'CompileFlags.cmake')
-rw-r--r--CompileFlags.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index b2044e4416..20f5decf1c 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -62,3 +62,9 @@ endif ()
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 ()