summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2025-09-29 18:11:24 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-02 11:28:03 +0100
commit5b89175dc13a4ee407f13f10309770eb99fa1250 (patch)
treec86a910ea50a87d3f508af627ab65d2e42c367da
parent9ece218efa2ae4920f18fe663bbadda18901b14e (diff)
downloadpoky-5b89175dc13a4ee407f13f10309770eb99fa1250.tar.gz
clang: fix reproducibility issue in LLVMConfig.cmake
The LLVMConfig.cmake file is mostly LLVM configuration, but it also specifies if some Python modules (needed by the opt-viewer tool) were present on the build host. This is host contamination and a source of non-determinism, so remove it from the installed file. A ticket has been filed upstream to resolve this: https://github.com/llvm/llvm-project/issues/161199 (From OE-Core rev: 916c074a136e8e07f388c2c41d197a15a4c50022) 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>
-rw-r--r--meta/recipes-devtools/clang/clang/0001-dont-expose-LLVM_HAVE_OPT_VIEWER_MODULES.patch29
-rw-r--r--meta/recipes-devtools/clang/common.inc1
2 files changed, 30 insertions, 0 deletions
diff --git a/meta/recipes-devtools/clang/clang/0001-dont-expose-LLVM_HAVE_OPT_VIEWER_MODULES.patch b/meta/recipes-devtools/clang/clang/0001-dont-expose-LLVM_HAVE_OPT_VIEWER_MODULES.patch
new file mode 100644
index 0000000000..4f6ab6d00f
--- /dev/null
+++ b/meta/recipes-devtools/clang/clang/0001-dont-expose-LLVM_HAVE_OPT_VIEWER_MODULES.patch
@@ -0,0 +1,29 @@
1From b6af0a5b42adfbebaca1ee673d4c1d9d10fbacfb Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com>
3Date: Mon, 29 Sep 2025 14:44:05 +0100
4Subject: [PATCH] Don't expose LLVM_HAVE_OPT_VIEWER_MODULES externally
5
6This variable states whether at build-time some python modules were present,
7which is meaningless and simply introduces non-deterministic behaviour.
8
9Upstream-Status: Pending [https://github.com/llvm/llvm-project/issues/161199]
10Signed-off-by: Ross Burton <ross.burton@arm.com>
11---
12 llvm/cmake/modules/LLVMConfig.cmake.in | 1 -
13 1 file changed, 1 deletion(-)
14
15diff --git a/llvm/cmake/modules/LLVMConfig.cmake.in b/llvm/cmake/modules/LLVMConfig.cmake.in
16index c15b9576cd5d..9cff70e4ef8e 100644
17--- a/llvm/cmake/modules/LLVMConfig.cmake.in
18+++ b/llvm/cmake/modules/LLVMConfig.cmake.in
19@@ -135,7 +135,6 @@ set(LLVM_DEFINITIONS "@LLVM_DEFINITIONS@")
20 set(LLVM_BINARY_DIR "@LLVM_CONFIG_BINARY_DIR@")
21 set(LLVM_CMAKE_DIR "@LLVM_CONFIG_CMAKE_DIR@")
22 set(LLVM_TOOLS_BINARY_DIR "@LLVM_CONFIG_TOOLS_BINARY_DIR@")
23-set(LLVM_HAVE_OPT_VIEWER_MODULES @LLVM_HAVE_OPT_VIEWER_MODULES@)
24 set(LLVM_CONFIGURATION_TYPES @CMAKE_CONFIGURATION_TYPES@)
25 set(LLVM_ENABLE_SHARED_LIBS @BUILD_SHARED_LIBS@)
26
27--
282.43.0
29
diff --git a/meta/recipes-devtools/clang/common.inc b/meta/recipes-devtools/clang/common.inc
index 512bf1dd02..b8f7d41089 100644
--- a/meta/recipes-devtools/clang/common.inc
+++ b/meta/recipes-devtools/clang/common.inc
@@ -61,6 +61,7 @@ SRC_URI = "\
61 file://0038-Prevent-revisiting-block-when-searching-for-noreturn.patch \ 61 file://0038-Prevent-revisiting-block-when-searching-for-noreturn.patch \
62 file://0039-Only-build-c-index-test-when-clang-tests-are-include.patch \ 62 file://0039-Only-build-c-index-test-when-clang-tests-are-include.patch \
63 file://0001-Install-lldb-tblgen.patch \ 63 file://0001-Install-lldb-tblgen.patch \
64 file://0001-dont-expose-LLVM_HAVE_OPT_VIEWER_MODULES.patch \
64" 65"
65# Fallback to no-PIE if not set 66# Fallback to no-PIE if not set
66GCCPIE ??= "" 67GCCPIE ??= ""