[llvm-branch-commits] [clang] release/22.x: [hexagon] Add dylib cmake + toolchain_only (#177247) (PR #178334)
Ankit Aggarwal via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Feb 17 12:04:05 PST 2026
https://github.com/aankit-ca updated https://github.com/llvm/llvm-project/pull/178334
>From 0e5ae73dff3763ada69a3050394c24230e2575f9 Mon Sep 17 00:00:00 2001
From: Brian Cain <brian.cain at oss.qualcomm.com>
Date: Tue, 27 Jan 2026 18:34:44 -0700
Subject: [PATCH] [hexagon] Add dylib cmake + toolchain_only (#177247)
The toolchains take up much less space when we enable dylib, so let's
create an option to build them that way.
Also: TOOLCHAIN_ONLY was ineffective in
hexagon-unknown-linux-musl-clang-cross.cmake because cmake takes the
first setting from hexagon-unknown-linux-musl-clang.cmake with
precedence. FORCE it to fix that issue.
Signed-off-by: Brian Cain <brian.cain at oss.qualcomm.com>
(cherry picked from commit cf4ce383b3c7776c06ee744acebfec1e0c1c946d)
---
.../caches/hexagon-unknown-linux-musl-clang-cross.cmake | 4 +++-
.../caches/hexagon-unknown-linux-musl-clang-dylib.cmake | 7 +++++++
2 files changed, 10 insertions(+), 1 deletion(-)
create mode 100644 clang/cmake/caches/hexagon-unknown-linux-musl-clang-dylib.cmake
diff --git a/clang/cmake/caches/hexagon-unknown-linux-musl-clang-cross.cmake b/clang/cmake/caches/hexagon-unknown-linux-musl-clang-cross.cmake
index fd2aeec819fc0..e6b4e8c047b34 100644
--- a/clang/cmake/caches/hexagon-unknown-linux-musl-clang-cross.cmake
+++ b/clang/cmake/caches/hexagon-unknown-linux-musl-clang-cross.cmake
@@ -15,4 +15,6 @@ set(CLANG_LINKS_TO_CREATE
clang-cpp
CACHE STRING "")
-set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
+# Note: FORCE is required to override the OFF setting in hexagon-unknown-linux-musl-clang.cmake
+# which is loaded earlier in the -C chain.
+set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "" FORCE)
diff --git a/clang/cmake/caches/hexagon-unknown-linux-musl-clang-dylib.cmake b/clang/cmake/caches/hexagon-unknown-linux-musl-clang-dylib.cmake
new file mode 100644
index 0000000000000..1a02ff25417bd
--- /dev/null
+++ b/clang/cmake/caches/hexagon-unknown-linux-musl-clang-dylib.cmake
@@ -0,0 +1,7 @@
+set(LLVM_BUILD_LLVM_DYLIB ON CACHE BOOL "")
+set(LLVM_LINK_LLVM_DYLIB ON CACHE BOOL "")
+set(CLANG_LINK_LLVM_DYLIB ON CACHE BOOL "")
+
+# Clear version suffix to prevent versioned library names like libLLVM.so.22.1-rc1
+# which lld doesn't recognize. This results in libLLVM.so.22.1 instead.
+set(LLVM_VERSION_SUFFIX "" CACHE STRING "")
More information about the llvm-branch-commits
mailing list