diff options
author | Daniel Sanders <daniel.sanders@imgtec.com> | 2015-04-20 12:44:01 +0000 |
---|---|---|
committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2015-04-20 12:44:01 +0000 |
commit | dae9d091e4e0f0a40eb6267f871b52fad09f5c48 (patch) | |
tree | ac89e456b40e4b18719c862eef9ba5615267de86 /cmake | |
parent | 96c872a019f92644aa088651b70f037b38c3fe16 (diff) |
[mips] Support building compiler-rt with gcc.
Summary:
This will allow us to enable it on the buildbot (and then enable a
sanitizer buildbot).
The problem is that gcc for Mips does not accept -m32/-m64 like clang does.
We therefore need to use the nearest equivalent -mips32r2/-mips64r2. We must
also specify -mabi=64 in the -mips64r2 case since gcc's default ABI has
traditionally been N32 whereas clang's is N64.
Reviewers: sagar
Reviewed By: sagar
Subscribers: llvm-commits, samsonov, kcc, mohit.bhakkad, Anand.Takale, sagar
Differential Revision: http://reviews.llvm.org/D8892
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@235299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/config-ix.cmake | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index 1b7cceb7a..5574dc2a3 100644 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -177,13 +177,18 @@ else() test_target_arch(powerpc64le "" "-m64") endif() elseif("${LLVM_NATIVE_ARCH}" STREQUAL "Mips") + # Gcc doesn't accept -m32/-m64 so we do the next best thing and use + # -mips32r2/-mips64r2. We don't use -mips1/-mips3 because we want to match + # clang's default CPU's. In the 64-bit case, we must also specify the ABI + # since the default ABI differs between gcc and clang. + # 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 "" "-m32") - test_target_arch(mips64el "" "-m64") + test_target_arch(mipsel "" "-mips32r2") + test_target_arch(mips64el "" "-mips64r2 -mabi=n64") else() - test_target_arch(mips "" "-m32") - test_target_arch(mips64 "" "-m64") + test_target_arch(mips "" "-mips32r2") + test_target_arch(mips64 "" "-mips64r2 -mabi=n64") endif() elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "arm") test_target_arch(arm "" "-march=armv7-a") |