[clang] ea62db0 - [cmake] Add hexagon-linux cmake cache files (#98712)

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 3 06:11:39 PDT 2024


Author: Brian Cain
Date: 2024-10-03T08:11:34-05:00
New Revision: ea62db0c0398ec2e7d7c4c6561feb3b4ace98050

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

LOG: [cmake] Add hexagon-linux cmake cache files (#98712)

These can be used to create a fully-bootstrapped toolchain to target
hexagon {baremetal,linux} with scripts like the ones in
https://github.com/quic/toolchain_for_hexagon

Added: 
    clang/cmake/caches/hexagon-unknown-linux-musl-clang-cross.cmake
    clang/cmake/caches/hexagon-unknown-linux-musl-clang.cmake
    compiler-rt/cmake/caches/hexagon-linux-builtins.cmake
    compiler-rt/cmake/caches/hexagon-linux-clangrt.cmake
    libcxx/cmake/caches/hexagon-linux-runtimes.cmake

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang/cmake/caches/hexagon-unknown-linux-musl-clang-cross.cmake b/clang/cmake/caches/hexagon-unknown-linux-musl-clang-cross.cmake
new file mode 100644
index 00000000000000..91bbe26b621054
--- /dev/null
+++ b/clang/cmake/caches/hexagon-unknown-linux-musl-clang-cross.cmake
@@ -0,0 +1,15 @@
+# This file is for the llvm+clang options that are specific to building
+# a cross-toolchain targeting hexagon linux.
+set(DEFAULT_SYSROOT "../target/hexagon-unknown-linux-musl/" CACHE STRING "")
+set(CLANG_LINKS_TO_CREATE
+            hexagon-linux-musl-clang++
+            hexagon-linux-musl-clang
+            hexagon-unknown-linux-musl-clang++
+            hexagon-unknown-linux-musl-clang
+            hexagon-none-elf-clang++
+            hexagon-none-elf-clang
+            hexagon-unknown-none-elf-clang++
+            hexagon-unknown-none-elf-clang
+            CACHE STRING "")
+
+set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")

diff  --git a/clang/cmake/caches/hexagon-unknown-linux-musl-clang.cmake b/clang/cmake/caches/hexagon-unknown-linux-musl-clang.cmake
new file mode 100644
index 00000000000000..9f3eb4678fd17b
--- /dev/null
+++ b/clang/cmake/caches/hexagon-unknown-linux-musl-clang.cmake
@@ -0,0 +1,15 @@
+
+set(LLVM_TARGETS_TO_BUILD "Hexagon" CACHE STRING "")
+set(LLVM_DEFAULT_TARGET_TRIPLE "hexagon-unknown-linux-musl" CACHE STRING "")
+set(CLANG_DEFAULT_CXX_STDLIB "libc++" CACHE STRING "")
+set(CLANG_DEFAULT_OBJCOPY "llvm-objcopy" CACHE STRING "")
+set(CLANG_DEFAULT_RTLIB "compiler-rt" CACHE STRING "")
+set(CLANG_DEFAULT_UNWINDLIB "libunwind" CACHE STRING "")
+set(CLANG_DEFAULT_LINKER "lld" CACHE STRING "")
+set(LLVM_ENABLE_PROJECTS "clang;lld" CACHE STRING "")
+
+set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
+set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
+# Enabling toolchain-only causes problems when doing some of the
+# subsequent builds, will need to investigate:
+set(LLVM_INSTALL_TOOLCHAIN_ONLY OFF CACHE BOOL "")

diff  --git a/compiler-rt/cmake/caches/hexagon-linux-builtins.cmake b/compiler-rt/cmake/caches/hexagon-linux-builtins.cmake
new file mode 100644
index 00000000000000..d9c9ff2a4655ee
--- /dev/null
+++ b/compiler-rt/cmake/caches/hexagon-linux-builtins.cmake
@@ -0,0 +1,15 @@
+set(CMAKE_ASM_FLAGS "-G0 -mlong-calls -fno-pic" CACHE STRING "")
+
+set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR OFF CACHE BOOL "")
+set(LLVM_TARGET_TRIPLE hexagon-unknown-linux-musl CACHE STRING "")
+set(COMPILER_RT_DEFAULT_TARGET_TRIPLE hexagon-unknown-linux-musl CACHE STRING "")
+set(COMPILER_RT_BUILD_BUILTINS ON CACHE BOOL "")
+set(COMPILER_RT_BUILD_SANITIZERS OFF CACHE BOOL "")
+set(COMPILER_RT_BUILD_XRAY OFF CACHE BOOL "")
+set(COMPILER_RT_BUILD_LIBFUZZER OFF CACHE BOOL "")
+set(COMPILER_RT_BUILD_PROFILE OFF CACHE BOOL "")
+set(COMPILER_RT_BUILD_MEMPROF OFF CACHE BOOL "")
+set(COMPILER_RT_BUILD_ORC OFF CACHE BOOL "")
+set(COMPILER_RT_BUILD_GWP_ASAN OFF CACHE BOOL "")
+set(COMPILER_RT_BUILTINS_ENABLE_PIC OFF CACHE BOOL "")
+set(COMPILER_RT_SUPPORTED_ARCH hexagon CACHE STRING "")

diff  --git a/compiler-rt/cmake/caches/hexagon-linux-clangrt.cmake b/compiler-rt/cmake/caches/hexagon-linux-clangrt.cmake
new file mode 100644
index 00000000000000..baf149306f91bb
--- /dev/null
+++ b/compiler-rt/cmake/caches/hexagon-linux-clangrt.cmake
@@ -0,0 +1,14 @@
+
+set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR OFF CACHE BOOL "")
+set(LLVM_DEFAULT_TARGET_TRIPLE hexagon-unknown-linux-musl CACHE STRING "")
+
+set(COMPILER_RT_USE_LLVM_UNWINDER ON CACHE BOOL "")
+
+# Some build failures here, including the inline asm in
+# `compiler-rt/lib/sanitizer_common/sanitizer_redefine_builtins.h`, so
+# we can just disable these for now:
+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 "")
+

diff  --git a/libcxx/cmake/caches/hexagon-linux-runtimes.cmake b/libcxx/cmake/caches/hexagon-linux-runtimes.cmake
new file mode 100644
index 00000000000000..7f309de9a14e60
--- /dev/null
+++ b/libcxx/cmake/caches/hexagon-linux-runtimes.cmake
@@ -0,0 +1,15 @@
+
+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(LIBCXXABI_ENABLE_SHARED ON CACHE BOOL "")
+
+set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
+set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
+set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")


        


More information about the cfe-commits mailing list