summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSagar Thakur <sagar.thakur@imgtec.com>2015-05-19 09:07:37 +0000
committerSagar Thakur <sagar.thakur@imgtec.com>2015-05-19 09:07:37 +0000
commitc5effe75b550641478599a09972de86ac0dbcef7 (patch)
tree54d8a398508480bca3ddccda214a6ebd64b327cc /cmake
parent7fe3eca5365b970f138092e2ae225d7425db6fb1 (diff)
[sanitizer][MIPS] Add --target flag for MIPS32
Without the --target flag, clang uses the mips64 triple which selects the n64 abi. We need to add --target=mips-linux-gnu, so that clang can select the correct abi for mips32r2. Reviewers: dsanders, kcc, samsonov Subscribers: llvm-commits, mohit.bhakkad, jaydeep Differential Revision: http://reviews.llvm.org/D9249 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@237675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/config-ix.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index e62715ea6..d69d73d41 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -196,11 +196,11 @@ else()
# FIXME: Ideally, we would build the N32 library too.
if("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "mipsel|mips64el")
# regex for mipsel, mips64el
- test_target_arch(mipsel "" "-mips32r2")
- test_target_arch(mips64el "" "-mips64r2 -mabi=n64")
+ test_target_arch(mipsel "" "-mips32r2" "--target=mipsel-linux-gnu")
+ test_target_arch(mips64el "" "-mips64r2" "-mabi=n64")
else()
- test_target_arch(mips "" "-mips32r2")
- test_target_arch(mips64 "" "-mips64r2 -mabi=n64")
+ test_target_arch(mips "" "-mips32r2" "--target=mips-linux-gnu")
+ test_target_arch(mips64 "" "-mips64r2" "-mabi=n64")
endif()
elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "arm")
test_target_arch(arm "" "-march=armv7-a")
@@ -226,6 +226,7 @@ function(filter_available_targets out_var)
set(${out_var} ${archs} PARENT_SCOPE)
endfunction()
+# Returns a list of architecture specific target cflags in @out_var list.
function(get_target_flags_for_arch arch out_var)
list(FIND COMPILER_RT_SUPPORTED_ARCH ${arch} ARCH_INDEX)
if(ARCH_INDEX EQUAL -1)