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 | ffa272ebbb7217c846ac2a92ff3f04be382ae854 (patch) | |
| tree | b9a1426dfab9dea134ca8d22c34439f681a6698b | |
| parent | 6ca13eaf821a7825212a0c58afd44bfd791dc158 (diff) | |
| download | bcm5719-llvm-ffa272ebbb7217c846ac2a92ff3f04be382ae854.tar.gz bcm5719-llvm-ffa272ebbb7217c846ac2a92ff3f04be382ae854.zip | |
[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
llvm-svn: 235299
| -rw-r--r-- | compiler-rt/cmake/config-ix.cmake | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake index 1b7cceb7a79..5574dc2a3e9 100644 --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/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") |

