summaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2018-11-16 04:14:23 +0000
committerPetr Hosek <phosek@chromium.org>2018-11-16 04:14:23 +0000
commit632c1cf046df670d3138e2776d0e453047693f32 (patch)
treea0d64700295ac914c75237fd96c4299a2fce4fb2 /cmake/Modules
parentb3dc414207998ec6e4cf86cee11bb74edafd2b79 (diff)
downloadcompiler-rt-632c1cf046df670d3138e2776d0e453047693f32.tar.gz
[compiler-rt] Use exact spelling when building for default target
When building for default target only, use exact target spelling when deriving the name for the per-target runtime directory. This is necessary for AArch32 where the CMake build by default rewrites the architecture which leads to unexpected results. Differential Revision: https://reviews.llvm.org/D54612 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@347022 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/CompilerRTUtils.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake
index d2cb48677..c4500328e 100644
--- a/cmake/Modules/CompilerRTUtils.cmake
+++ b/cmake/Modules/CompilerRTUtils.cmake
@@ -337,7 +337,10 @@ endfunction()
function(get_compiler_rt_target arch variable)
string(FIND ${COMPILER_RT_DEFAULT_TARGET_TRIPLE} "-" dash_index)
string(SUBSTRING ${COMPILER_RT_DEFAULT_TARGET_TRIPLE} ${dash_index} -1 triple_suffix)
- if(ANDROID AND ${arch} STREQUAL "i386")
+ if(COMPILER_RT_DEFAULT_TARGET_ONLY)
+ # Use exact spelling when building only for the target specified to CMake.
+ set(target "${COMPILER_RT_DEFAULT_TARGET_TRIPLE}")
+ elseif(ANDROID AND ${arch} STREQUAL "i386")
set(target "i686${COMPILER_RT_OS_SUFFIX}${triple_suffix}")
else()
set(target "${arch}${triple_suffix}")