From 87e43ef9dee0a57f2fef86e90c24c987faaedb53 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Fri, 29 Sep 2017 13:32:39 +0000 Subject: [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 --- cmake/base-config-ix.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmake/base-config-ix.cmake') 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() -- cgit v1.2.3