aboutsummaryrefslogtreecommitdiff
path: root/llvm/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2022-12-01 14:54:17 +0000
committerDavid Spickett <david.spickett@linaro.org>2023-01-31 09:49:56 +0000
commitcd173cbd7cca69c29df42cd4b42e60433435c29b (patch)
tree8ae20111541cc266544cc5d7cc099a4b5a3dfe20 /llvm/CMakeLists.txt
parenta6f66d57e1d626a9b676f6e3ec0e084bdca3a934 (diff)
downloadllvm-cd173cbd7cca69c29df42cd4b42e60433435c29b.zip
llvm-cd173cbd7cca69c29df42cd4b42e60433435c29b.tar.gz
llvm-cd173cbd7cca69c29df42cd4b42e60433435c29b.tar.bz2
[clang][compiler-rt] Support LLVM_ENABLE_PER_TARGET_RUNTIME_DIR on Arm Linux and BSD
The orginal single folder layout produced libraries in the form: lib/linux/<libname>-<archname>.a That archname for Arm depended on whether you had hard or soft float. This is sometimes shown as "arm" (soft) vs. "armhf" (hard). If this is set in a triple we do it in the final portion, the ABI. "gnueabi" for soft float, "gnueabihf" for hard float. Meaning that the expected triple is: arm-unknown-linux-gnueabihf Not this: armhf-unknown-linux-gnueabihf For the per target layout I have decided to rely on the ABI portion of the triple instead of the arch name used for the old layout (doing that would produce the invalid triple above). This means that building with triple: armv8l-unknown-linux-gnueabihf Will result in libraries in: lib/arm-unknown-linux-gnueabihf/ And clang will now know to look for "arm" instead of "armv8l". Meaning that we can share libraries between an armv8 and armv7 build as we did with the previous layout. In addition to handling spelling differences e.g. "armv8l" with an "l" on some Linux distros. compiler-rt will autodetect that the "armhf" and/or "arm" architecture can be built. We then replace the given triple's architecture with that. Then if the triple's float ABI doesn't match, we change that. That new triple is then used as the folder name. If you select to build only the given triple, with COMPILER_RT_DEFAULT_TARGET_ONLY, compiler-rt will not autodetect the architecture and for that I assume you know what you're doing. In that case the library path will use the unomdified triple. From what I can tell, this is how most large builds e.g Android and Arm's Embedded Toolchain for llvm do things. I assume that big endian "armeb" builds would end up doing this too. Bare metal builds will not be using per target runtime dirs so they remain as they were. Depends on D139536 Reviewed By: MaskRay, phosek Differential Revision: https://reviews.llvm.org/D140011
Diffstat (limited to 'llvm/CMakeLists.txt')
-rw-r--r--llvm/CMakeLists.txt3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 8a02f01..49eabd1 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -817,8 +817,7 @@ endif()
set(LLVM_TARGET_TRIPLE_ENV CACHE STRING "The name of environment variable to override default target. Disabled by blank.")
mark_as_advanced(LLVM_TARGET_TRIPLE_ENV)
-# Per target dir not yet supported on Arm 32 bit due to arm vs armhf handling
-if(CMAKE_SYSTEM_NAME MATCHES "BSD|Linux" AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
+if(CMAKE_SYSTEM_NAME MATCHES "BSD|Linux")
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default ON)
else()
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default OFF)