summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2025-10-07 11:42:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-09 10:58:07 +0100
commitff83c5de2e01627d070fd0b31068186e40cd9994 (patch)
treef8a5b7bb725440805360bb44a86f4e3f3c909df2
parent840d4fc3c5b86ed688d85b897f0a620ba73325c4 (diff)
downloadpoky-ff83c5de2e01627d070fd0b31068186e40cd9994.tar.gz
clang: globally disable build-time RPATHs for reproducibility
Various bits of the LLVM project set the build RPATH in a way that means we have non-deterministic binaries even though we should always be using relative paths. This clearly is not working as some of the binaries get rewritten on install and have large string paddings that correlate with erased build paths. So that we don't have to disable RPATHs in every recipe, just do it once in the common include file and remove the existing recipe-specific assignments that are now not needed. (From OE-Core rev: acc8c5c89c0f1bff3413d2301a65afd89bd0d9ff) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/clang/common-clang.inc4
-rw-r--r--meta/recipes-devtools/clang/libcxx_git.bb1
-rw-r--r--meta/recipes-devtools/clang/lld_git.bb6
3 files changed, 5 insertions, 6 deletions
diff --git a/meta/recipes-devtools/clang/common-clang.inc b/meta/recipes-devtools/clang/common-clang.inc
index ca3a3a08b4..f7b7a1cf9a 100644
--- a/meta/recipes-devtools/clang/common-clang.inc
+++ b/meta/recipes-devtools/clang/common-clang.inc
@@ -44,4 +44,8 @@ def get_clang_host_arch(bb, d):
44def get_clang_target_arch(bb, d): 44def get_clang_target_arch(bb, d):
45 return get_clang_arch(bb, d, 'TARGET_ARCH') 45 return get_clang_arch(bb, d, 'TARGET_ARCH')
46 46
47# Don't put build-time RPATHs in the binaries, whilst they'll be stripped on
48# install they cause non-deterministic binaries.
49EXTRA_OECMAKE += "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON"
50
47require common.inc 51require common.inc
diff --git a/meta/recipes-devtools/clang/libcxx_git.bb b/meta/recipes-devtools/clang/libcxx_git.bb
index b0ee3925f4..c630bd973e 100644
--- a/meta/recipes-devtools/clang/libcxx_git.bb
+++ b/meta/recipes-devtools/clang/libcxx_git.bb
@@ -77,7 +77,6 @@ EXTRA_OECMAKE += "\
77 -DLLVM_RUNTIME_TARGETS=${HOST_ARCH} \ 77 -DLLVM_RUNTIME_TARGETS=${HOST_ARCH} \
78 -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ 78 -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \
79 -DLLVM_APPEND_VC_REV=OFF \ 79 -DLLVM_APPEND_VC_REV=OFF \
80 -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
81" 80"
82 81
83EXTRA_OECMAKE:append:class-target = " \ 82EXTRA_OECMAKE:append:class-target = " \
diff --git a/meta/recipes-devtools/clang/lld_git.bb b/meta/recipes-devtools/clang/lld_git.bb
index b0261ad2cb..ba36942790 100644
--- a/meta/recipes-devtools/clang/lld_git.bb
+++ b/meta/recipes-devtools/clang/lld_git.bb
@@ -14,13 +14,9 @@ DEPENDS = "llvm-tblgen-native llvm"
14 14
15OECMAKE_SOURCEPATH = "${S}/lld" 15OECMAKE_SOURCEPATH = "${S}/lld"
16 16
17# Explicitly disable RPATHs as otherwise they're stipped out of the binaries,
18# and are then non-reproducible.
19#
20# Explicitly enable symlinks as the lld build doesn't call into the llvm setup 17# Explicitly enable symlinks as the lld build doesn't call into the llvm setup
21# and turn that on. 18# and turn that on.
22EXTRA_OECMAKE += "-DCMAKE_SKIP_BUILD_RPATH=ON \ 19EXTRA_OECMAKE += "-DLLVM_INCLUDE_TESTS=OFF -DLLVM_USE_SYMLINKS=ON \
23 -DLLVM_INCLUDE_TESTS=OFF -DLLVM_USE_SYMLINKS=ON \
24 -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen" 20 -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen"
25 21
26BBCLASSEXTEND = "native nativesdk" 22BBCLASSEXTEND = "native nativesdk"