[libcxx-commits] [clang] [compiler-rt] [libcxx] [cmake] Add hexagon-linux cmake cache files (PR #98712)
Brian Cain via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Sep 5 08:10:21 PDT 2024
================
@@ -0,0 +1,25 @@
+
+set(LLVM_DEFAULT_TARGET_TRIPLE hexagon-unknown-linux-musl CACHE STRING "")
+set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR OFF CACHE BOOL "")
+set(LLVM_ENABLE_RUNTIMES libcxx;libcxxabi;libunwind;compiler-rt CACHE STRING "")
+set(LIBCXX_INCLUDE_BENCHMARKS OFF CACHE BOOL "")
+set(LIBCXX_HAS_MUSL_LIBC ON CACHE BOOL "")
+set(LIBCXX_INCLUDE_TESTS OFF CACHE BOOL "")
+set(LIBCXXABI_INCLUDE_TESTS OFF CACHE BOOL "")
+set(LIBUNWIND_INCLUDE_TESTS OFF CACHE BOOL "")
+set(LIBCXX_CXX_ABI libcxxabi CACHE STRING "")
+set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+set(COMPILER_RT_USE_LLVM_UNWINDER ON CACHE BOOL "")
+set(LIBCXXABI_ENABLE_SHARED ON CACHE BOOL "")
+
+set(COMPILER_RT_BUILD_BUILTINS OFF CACHE BOOL "")
+set(COMPILER_RT_BUILD_SANITIZERS OFF CACHE BOOL "")
+set(COMPILER_RT_BUILD_XRAY OFF CACHE BOOL "")
+set(COMPILER_RT_BUILD_MEMPROF OFF CACHE BOOL "")
----------------
androm3da wrote:
These are build options -- they indicate the scope of what to build - but the defaults are overridden specifically for the hexagon toolchain. This is in order to avoid defects either in the code we're building or in the compiler. There's no existing cache that could know about these architecture-specific bugs, I figure.
For example, in `compiler-rt/lib/sanitizer_common/sanitizer_redefine_builtins.h` there's these inline asm statements to alias some functions - the hexagon assembler rejects these.
```
asm("memcpy = __sanitizer_internal_memcpy");
asm("memmove = __sanitizer_internal_memmove");
asm("memset = __sanitizer_internal_memset");
```
I think it probably makes sense to use a directive instead of this syntax which isn't (as) portable. Or maybe it's a bug in the assembler. In any case, I'd like to punt and just descope the toolchain build for now.
But maybe I've misunderstood what you're trying to say about the compiler-rt CMake caches - maybe I should specify these outside of `hexagon-linux-runtimes.cmake` in `hexagon-linux-compiler-rt.cmake`? If so, that's fine w/me (though we'll be loading both cache files when building the runtimes).
https://github.com/llvm/llvm-project/pull/98712
More information about the libcxx-commits
mailing list