diff options
author | Ross Burton <ross.burton@arm.com> | 2025-10-07 11:42:44 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-07 22:31:08 +0100 |
commit | 833f21760d1d83668c0ebfd597edb51a9d6f6be8 (patch) | |
tree | 180f5fd5e263126f5f6b255a16ccd8cd6b9b0a81 | |
parent | d6e1bb153db3ea5be5539618419a17430f715224 (diff) | |
download | poky-833f21760d1d83668c0ebfd597edb51a9d6f6be8.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: 7ae30b5b9aab3037ae66b0491cdf1af34d38b20f)
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.inc | 4 | ||||
-rw-r--r-- | meta/recipes-devtools/clang/libcxx_git.bb | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/clang/lld_git.bb | 6 |
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): | |||
44 | def get_clang_target_arch(bb, d): | 44 | def 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. | ||
49 | EXTRA_OECMAKE += "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON" | ||
50 | |||
47 | require common.inc | 51 | require 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 | ||
83 | EXTRA_OECMAKE:append:class-target = " \ | 82 | EXTRA_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 | ||
15 | OECMAKE_SOURCEPATH = "${S}/lld" | 15 | OECMAKE_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. |
22 | EXTRA_OECMAKE += "-DCMAKE_SKIP_BUILD_RPATH=ON \ | 19 | EXTRA_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 | ||
26 | BBCLASSEXTEND = "native nativesdk" | 22 | BBCLASSEXTEND = "native nativesdk" |