diff options
-rw-r--r-- | compiler-rt/CMakeLists.txt | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index c33848bbefa..b9c232393d3 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -43,16 +43,12 @@ set(COMPILER_RT_LINUX_SDK_SYSROOT ${COMPILER_RT_SOURCE_DIR}/SDKs/linux) # Detect whether the current target platform is 32-bit or 64-bit, and setup # the correct commandline flags needed to attempt to target 32-bit and 64-bit. -if(CMAKE_SIZEOF_VOID_P EQUAL 4 OR LLVM_BUILD_32_BITS) - set(TARGET_64_BIT_CFLAGS "-m64") - set(TARGET_32_BIT_CFLAGS "") -else() - if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) - message(FATAL_ERROR "Please use a sane architecture with 4 or 8 byte pointers.") - endif() - set(TARGET_64_BIT_CFLAGS "") - set(TARGET_32_BIT_CFLAGS "-m32") +if (NOT CMAKE_SIZEOF_VOID_P EQUAL 4 AND + NOT CMAKE_SIZEOF_VOID_P EQUAL 8) + message(FATAL_ERROR "Please use architecture with 4 or 8 byte pointers.") endif() +set(TARGET_64_BIT_CFLAGS "-m64") +set(TARGET_32_BIT_CFLAGS "-m32") # List of architectures we can target. set(COMPILER_RT_SUPPORTED_ARCH) @@ -90,10 +86,7 @@ if("${LLVM_NATIVE_ARCH}" STREQUAL "X86") test_target_arch(x86_64 ${TARGET_64_BIT_CFLAGS}) test_target_arch(i386 ${TARGET_32_BIT_CFLAGS}) elseif("${LLVM_NATIVE_ARCH}" STREQUAL "PowerPC") - # Explicitly set -m flag on powerpc, because on ppc64 defaults for gcc and - # clang are different. - test_target_arch(powerpc64 "-m64") - test_target_arch(powerpc "-m32") + test_target_arch(powerpc64 ${TARGET_64_BIT_CFLAGS}) endif() # We only support running instrumented tests when we're not cross compiling |