From: Deepesh.Varatharajan@windriver.com
To: openembedded-core@lists.openembedded.org
Cc: Randy.Macleod@windriver.com, Sundeep.Kokkonda@windriver.com,
Deepesh.Varatharajan@windriver.com
Subject: [PATCH 2/4 V2] clang: Use CLANG_ENABLE_TESTSUITE to enable LLVM, Clang, and LLD tests
Date: Sun, 1 Mar 2026 22:49:36 -0800 [thread overview]
Message-ID: <20260302064938.2052450-3-Deepesh.Varatharajan@windriver.com> (raw)
In-Reply-To: <20260302064938.2052450-1-Deepesh.Varatharajan@windriver.com>
From: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
Introduce the CLANG_ENABLE_TESTSUITE variable to control building and
running tests for LLVM, Clang, and LLD. When enabled, the necessary
CMake flags are applied, and LLVM target tools required to run tests.
Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
---
meta/recipes-devtools/clang/clang_git.bb | 8 ++++++++
meta/recipes-devtools/clang/lld_git.bb | 5 +++++
meta/recipes-devtools/clang/llvm_git.bb | 18 +++++++++++++++++-
3 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/clang/clang_git.bb b/meta/recipes-devtools/clang/clang_git.bb
index e10c327a2a..c3eeb34159 100644
--- a/meta/recipes-devtools/clang/clang_git.bb
+++ b/meta/recipes-devtools/clang/clang_git.bb
@@ -77,6 +77,14 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \
-DCMAKE_STRIP=${STAGING_BINDIR_NATIVE}/llvm-strip \
"
+CLANG_ENABLE_TESTSUITE ??= "0"
+CLANG_TESTSUITE_FLAGS = "\
+ -DCLANG_INCLUDE_TESTS=ON \
+ -DLLVM_INCLUDE_TESTS=ON \
+"
+
+EXTRA_OECMAKE:append:class-target = " ${@bb.utils.contains('CLANG_ENABLE_TESTSUITE', '1', d.getVar('CLANG_TESTSUITE_FLAGS'), '', d)}"
+
DEPENDS = "llvm-tblgen-native llvm-native llvm binutils zlib zstd libffi libxml2 libxml2-native"
DEPENDS:append:class-target = " ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcxx', '', d)}"
diff --git a/meta/recipes-devtools/clang/lld_git.bb b/meta/recipes-devtools/clang/lld_git.bb
index ba36942790..8960cac2d3 100644
--- a/meta/recipes-devtools/clang/lld_git.bb
+++ b/meta/recipes-devtools/clang/lld_git.bb
@@ -19,4 +19,9 @@ OECMAKE_SOURCEPATH = "${S}/lld"
EXTRA_OECMAKE += "-DLLVM_INCLUDE_TESTS=OFF -DLLVM_USE_SYMLINKS=ON \
-DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen"
+CLANG_ENABLE_TESTSUITE ??= "0"
+LLD_TESTSUITE_FLAGS = "-DLLVM_INCLUDE_TESTS=ON"
+
+EXTRA_OECMAKE:append:class-target = " ${@bb.utils.contains('CLANG_ENABLE_TESTSUITE', '1', d.getVar('LLD_TESTSUITE_FLAGS'), '', d)}"
+
BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/clang/llvm_git.bb b/meta/recipes-devtools/clang/llvm_git.bb
index 96ea383731..128cfb0a90 100644
--- a/meta/recipes-devtools/clang/llvm_git.bb
+++ b/meta/recipes-devtools/clang/llvm_git.bb
@@ -80,6 +80,18 @@ PACKAGECONFIG[opt-viewer] = "-DLLVM_TOOL_OPT_VIEWER_BUILD=ON,-DLLVM_TOOL_OPT_VIE
PACKAGECONFIG[lto] = "-DLLVM_ENABLE_LTO=Full -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils,"
PACKAGECONFIG[thin-lto] = "-DLLVM_ENABLE_LTO=Thin -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR},,binutils,"
+CLANG_ENABLE_TESTSUITE ??= "0"
+LLVM_TESTSUITE_FLAGS = "\
+ -DLLVM_BUILD_TESTS=ON \
+ -DLLVM_INSTALL_GTEST=ON \
+ -DLLVM_INCLUDE_TESTS=ON \
+ -DLLVM_TOOL_LLVM_EXEGESIS_BUILD=ON \
+ -DLLVM_TOOL_OBJ2YAML_BUILD=ON \
+ -DLLVM_TOOL_YAML2OBJ_BUILD=ON \
+ "
+
+EXTRA_OECMAKE:append:class-target = " ${@bb.utils.contains('CLANG_ENABLE_TESTSUITE', '1', d.getVar('LLVM_TESTSUITE_FLAGS'), '', d) } "
+
# LLVM debug symbols are very large (several gigabytes), reduce the debug level
# so they're just hundreds of megabytes.
DEBUG_LEVELFLAG = "-g1"
@@ -119,13 +131,17 @@ do_install:append:class-native() {
}
SYSROOT_PREPROCESS_FUNCS:append:class-target = " llvm_sysroot_preprocess"
-SYSROOT_PREPROCESS_FUNCS:append:class-nativesdk = " llvm_sysroot_preprocess"
+SYSROOT_PREPROCESS_FUNCS:append:class-nativesdk = " llvm_sysroot_preprocess ${@bb.utils.contains('CLANG_ENABLE_TESTSUITE', '1', 'llvm_sysroot_preprocess_testsuite', '', d) }"
llvm_sysroot_preprocess() {
install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
install -m 0755 ${S}/llvm/tools/llvm-config/llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/
}
+llvm_sysroot_preprocess_testsuite() {
+ install -m 0755 ${B}/bin/* ${SYSROOT_DESTDIR}${bindir}/
+}
+
FILES:${PN}-dev += "${libdir}/llvm-config"
BBCLASSEXTEND = "native nativesdk"
--
2.49.0
next prev parent reply other threads:[~2026-03-02 6:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 6:49 [PATCH 0/4 V2] Oe-selftest for Clang, LLVM, LLD Deepesh.Varatharajan
2026-03-02 6:49 ` [PATCH 1/4 V2] clang-tools-extra: disable tests Deepesh.Varatharajan
2026-03-02 6:49 ` Deepesh.Varatharajan [this message]
2026-03-02 6:49 ` [PATCH 3/4 V2] oeqa/selftest/clang: Add oe-seltests for Clang/LLVM/LLD Deepesh.Varatharajan
2026-03-02 6:49 ` [PATCH 4/4 V2] rust: Fix rust build failure Deepesh.Varatharajan
2026-03-02 10:32 ` [PATCH 0/4 V2] Oe-selftest for Clang, LLVM, LLD Deepesh Varatharajan
2026-03-02 10:48 ` [OE-core] " Mathieu Dubois-Briand
2026-03-02 10:52 ` Deepesh Varatharajan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260302064938.2052450-3-Deepesh.Varatharajan@windriver.com \
--to=deepesh.varatharajan@windriver.com \
--cc=Randy.Macleod@windriver.com \
--cc=Sundeep.Kokkonda@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox