summaryrefslogtreecommitdiff
path: root/cmake/base-config-ix.cmake
diff options
context:
space:
mode:
authorJonas Hahnfeld <hahnjo@hahnjo.de>2017-09-29 13:32:39 +0000
committerJonas Hahnfeld <hahnjo@hahnjo.de>2017-09-29 13:32:39 +0000
commit87e43ef9dee0a57f2fef86e90c24c987faaedb53 (patch)
tree744fa3636da5565c571d9e8256655f81d7a20c65 /cmake/base-config-ix.cmake
parent283e436ec89b4b4a293870e83343f9cab9822f44 (diff)
[CMake] Fix configuration on PowerPC with sanitizers
TEST_BIG_ENDIAN() performs compile tests that will fail with -nodefaultlibs when building under LLVM_USE_SANITIZER. Differential Revision: https://reviews.llvm.org/D38277 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/base-config-ix.cmake')
-rw-r--r--cmake/base-config-ix.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
index 55f322538..45e490481 100644
--- a/cmake/base-config-ix.cmake
+++ b/cmake/base-config-ix.cmake
@@ -148,7 +148,13 @@ macro(test_targets)
endif()
endif()
elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc")
+ # Strip out -nodefaultlibs when calling TEST_BIG_ENDIAN. Configuration
+ # will fail with this option when building with a sanitizer.
+ cmake_push_check_state()
+ string(REPLACE "-nodefaultlibs" "" CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
TEST_BIG_ENDIAN(HOST_IS_BIG_ENDIAN)
+ cmake_pop_check_state()
+
if(HOST_IS_BIG_ENDIAN)
test_target_arch(powerpc64 "" "-m64")
else()