[PATCH] D98173: [compiler-rt] Normalize i?86 to i386 and armv* to arm for COMPILER_RT_DEFAULT_TARGET_ARCH

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 9 22:44:38 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG8bd2722f65cf: [compiler-rt] Normalize i?86 to i386 and armv* to arm for… (authored by mstorsjo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98173/new/

https://reviews.llvm.org/D98173

Files:
  compiler-rt/cmake/Modules/CompilerRTUtils.cmake


Index: compiler-rt/cmake/Modules/CompilerRTUtils.cmake
===================================================================
--- compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -326,6 +326,21 @@
 
   string(REPLACE "-" ";" TARGET_TRIPLE_LIST ${COMPILER_RT_DEFAULT_TARGET_TRIPLE})
   list(GET TARGET_TRIPLE_LIST 0 COMPILER_RT_DEFAULT_TARGET_ARCH)
+
+  # Map various forms of the architecture names to the canonical forms
+  # (as they are used by clang, see getArchNameForCompilerRTLib).
+  if("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "^i.86$")
+    # Android uses i686, but that's remapped at a later stage.
+    set(COMPILER_RT_DEFAULT_TARGET_ARCH "i386")
+  elseif ("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "^arm" AND
+          NOT "${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "^arm64")
+    if ("${COMPILER_RT_DEFAULT_TARGET_TRIPLE}" MATCHES ".*hf$")
+      set(COMPILER_RT_DEFAULT_TARGET_ARCH "armhf")
+    else()
+      set(COMPILER_RT_DEFAULT_TARGET_ARCH "arm")
+    endif()
+  endif()
+
   # Determine if test target triple is specified explicitly, and doesn't match the
   # default.
   if(NOT COMPILER_RT_DEFAULT_TARGET_TRIPLE STREQUAL TARGET_TRIPLE)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98173.329541.patch
Type: text/x-patch
Size: 1222 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210310/d957bc09/attachment.bin>


More information about the llvm-commits mailing list