summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-06-30 16:21:32 +0000
committerAlexey Samsonov <samsonov@google.com>2013-06-30 16:21:32 +0000
commit33b213565dd77087f754afdd691dbb06bcc5dcb5 (patch)
treeb2e1190db683cf5e4efc7d0f261762fd06bf28dc /CMakeLists.txt
parentfe18723033b4e06adcd339f67e9a63054380a63f (diff)
downloadcompiler-rt-33b213565dd77087f754afdd691dbb06bcc5dcb5.tar.gz
compiler-rt-33b213565dd77087f754afdd691dbb06bcc5dcb5.tar.bz2
compiler-rt-33b213565dd77087f754afdd691dbb06bcc5dcb5.tar.xz
Always set -m32/-m64 flags for targeting i386/x86_64 respectively. Apparently, there are platforms where the clang defaults are different from gcc
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@185287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 6 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c33848bb..b9c23239 100644
--- a/CMakeLists.txt
+++ b/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