[compiler-rt] cadc9cd - [compiler-rt] Handle non-canonical triples with new runtime lib layout

Rainer Orth via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 11 02:26:29 PDT 2022


Author: Rainer Orth
Date: 2022-09-11T11:25:53+02:00
New Revision: cadc9cdedfef892b00b17658a823e4846a71e3ac

URL: https://github.com/llvm/llvm-project/commit/cadc9cdedfef892b00b17658a823e4846a71e3ac
DIFF: https://github.com/llvm/llvm-project/commit/cadc9cdedfef892b00b17658a823e4846a71e3ac.diff

LOG: [compiler-rt] Handle non-canonical triples with new runtime lib layout

As described in Issue #54196
<https://github.com/llvm/llvm-project/issues/54196>, the ideas of `clang`
and `compiler-rt` where runtime libs are located with
`-DLLVM_ENABLE_RUNTIMES` can differ.  This is the `compiler-rt` side of the
patch I've used to get them in sync for the `amd64-pc-solaris2.11` and
`sparc64-unknown-linux-gnu` release builds.

Tested on  `amd64-pc-solaris2.11` and `sparc64-unknown-linux-gnu`.

Differential Revision: https://reviews.llvm.org/D133406

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
index debd8a5a8bf1f..9c9024c7e7d4d 100644
--- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -484,6 +484,10 @@ function(get_compiler_rt_target arch variable)
     set(target "${COMPILER_RT_DEFAULT_TARGET_TRIPLE}")
   elseif(ANDROID AND ${arch} STREQUAL "i386")
     set(target "i686${triple_suffix}")
+  elseif(${arch} STREQUAL "amd64")
+    set(target "x86_64${triple_suffix}")
+  elseif(${arch} STREQUAL "sparc64")
+    set(target "sparcv9${triple_suffix}")
   else()
     set(target "${arch}${triple_suffix}")
   endif()


        


More information about the llvm-commits mailing list