]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
clang: don't install c-index-test
authorRoss Burton <ross.burton@arm.com>
Tue, 29 Jul 2025 13:45:18 +0000 (14:45 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 4 Aug 2025 17:04:00 +0000 (18:04 +0100)
Specifically, c-index-test is a 35MB binary which isn't needed if we're
not running the tests.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/clang/clang/no-c-index-test.patch [new file with mode: 0644]
meta/recipes-devtools/clang/common.inc

diff --git a/meta/recipes-devtools/clang/clang/no-c-index-test.patch b/meta/recipes-devtools/clang/clang/no-c-index-test.patch
new file mode 100644 (file)
index 0000000..5573740
--- /dev/null
@@ -0,0 +1,43 @@
+From 714a9cb319a8946fa670c7e8bbe7f29f847fa45f Mon Sep 17 00:00:00 2001
+From: David Spickett <david.spickett@linaro.org>
+Date: Tue, 29 Jul 2025 14:17:56 +0000
+Subject: [PATCH 1/2] [clang] Only build c-index-test when clang tests are
+ included
+
+c-index-test is only used for testing, and it's used in tests
+that are already guarded by CLANG_INCLUDE_TESTS in clang/CMakeLists.txt.
+
+This change enables us to do builds with LLVM_INSTALL_TOOLCHAIN_ONLY=OFF,
+and CLANG_INCLUDE_TESTS=OFF, which contain the required files
+to build other bits of llvm-project standalone, but does not
+include c-index-test which we have no need for.
+
+Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/151157]
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+---
+ clang/tools/CMakeLists.txt | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git i/clang/tools/CMakeLists.txt w/clang/tools/CMakeLists.txt
+index 98c018e96848..5410dd8de843 100644
+--- i/clang/tools/CMakeLists.txt
++++ w/clang/tools/CMakeLists.txt
+@@ -2,7 +2,6 @@ create_subdirectory_options(CLANG TOOL)
+
+ add_clang_subdirectory(diagtool)
+ add_clang_subdirectory(driver)
+-add_clang_subdirectory(apinotes-test)
+ add_clang_subdirectory(clang-diff)
+ add_clang_subdirectory(clang-format)
+ add_clang_subdirectory(clang-fuzzer)
+@@ -18,7 +17,10 @@ if(HAVE_CLANG_REPL_SUPPORT)
+   add_clang_subdirectory(clang-repl)
+ endif()
+
++if(CLANG_INCLUDE_TESTS)
++add_clang_subdirectory(apinotes-test)
+ add_clang_subdirectory(c-index-test)
++endif()
+
+ add_clang_subdirectory(clang-refactor)
+ # For MinGW we only enable shared library if LLVM_LINK_LLVM_DYLIB=ON.
index d6280c2fbe38e27b8a561602e84b6fd674c95e5c..b2e08f829b0dcf120c4fb6e3836743adb716807e 100644 (file)
@@ -60,6 +60,7 @@ SRC_URI = "\
     file://0037-compiler-rt-Exclude-sync_fetch_and_-for-any-pre-ARMv.patch \
     file://0038-compiler-rt-Hardcode-uptr-sptr-typedefs-on-Mips-Linu.patch \
     file://0001-libclc-allow-existing-prepare-builtins-in-standalone.patch \
+    file://no-c-index-test.patch \
 "
 # Fallback to no-PIE if not set
 GCCPIE ??= ""