summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2015-07-30 02:04:27 +0000
committerHans Wennborg <hans@hanshq.net>2015-07-30 02:04:27 +0000
commitb07bdb6a2756415a411e37c69e073ecb10f5832a (patch)
treea7925bb191392faab38af2ecd4d40ada7dbfa701
parent08ed6c5512c277d646054f615e3b4786ac72db01 (diff)
downloadcompiler-rt-b07bdb6a2756415a411e37c69e073ecb10f5832a.tar.gz
Merging r243604:
------------------------------------------------------------------------ r243604 | hans | 2015-07-29 18:45:17 -0700 (Wed, 29 Jul 2015) | 13 lines [CMake] Pass -march=i686 when targeting i686 (PR24222) Clang will not define __i686__, even when the target triple is i686, without -march=i686. With this patch, the compiler-rt build will successfully detect that Clang can target i686. The open_memstream.cc test is a little funny. Before my patch, it was invoked with "-m32 -m64". To make it work after my -march change, I had to add '-march=x86-64'. Differential Revision: http://reviews.llvm.org/D11618 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_37@243608 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--cmake/config-ix.cmake3
-rw-r--r--test/sanitizer_common/TestCases/Linux/open_memstream.cc4
2 files changed, 4 insertions, 3 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index c645be4d8..a61b6dd18 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -179,7 +179,8 @@ else()
# FIXME: We build runtimes for both i686 and i386, as "clang -m32" may
# target different variant than "$CMAKE_C_COMPILER -m32". This part should
# be gone after we resolve PR14109.
- test_target_arch(i686 __i686__ "-m32")
+ # Use -march to make sure Clang defines __i686__; see PR24222.
+ test_target_arch(i686 __i686__ "-m32" "-march=i686")
test_target_arch(i386 __i386__ "-m32")
else()
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
diff --git a/test/sanitizer_common/TestCases/Linux/open_memstream.cc b/test/sanitizer_common/TestCases/Linux/open_memstream.cc
index 69097c094..8f725c322 100644
--- a/test/sanitizer_common/TestCases/Linux/open_memstream.cc
+++ b/test/sanitizer_common/TestCases/Linux/open_memstream.cc
@@ -1,5 +1,5 @@
-// RUN: %clangxx -m64 -O0 -g -xc++ %s -o %t && %run %t
-// RUN: %clangxx -m64 -O3 -g -xc++ %s -o %t && %run %t
+// RUN: %clangxx -m64 -march=x86-64 -O0 -g -xc++ %s -o %t && %run %t
+// RUN: %clangxx -m64 -march=x86-64 -O3 -g -xc++ %s -o %t && %run %t
// REQUIRES: x86_64-supported-target
#include <assert.h>