Skip to content

Commit

Permalink
[CMake] Fix configuration on PowerPC with sanitizers
Browse files Browse the repository at this point in the history
TEST_BIG_ENDIAN() performs compile tests that will fail with
-nodefaultlibs when building under LLVM_USE_SANITIZER.

Differential Revision: https://reviews.llvm.org/D38277

llvm-svn: 314512
  • Loading branch information
hahnjo committed Sep 29, 2017
1 parent 963da5b commit ddbb092
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler-rt/cmake/base-config-ix.cmake
Expand Up @@ -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()
Expand Down

0 comments on commit ddbb092

Please sign in to comment.