]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
clang: globally disable build-time RPATHs for reproducibility
authorRoss Burton <ross.burton@arm.com>
Mon, 15 Sep 2025 15:47:58 +0000 (16:47 +0100)
committerKhem Raj <raj.khem@gmail.com>
Thu, 2 Oct 2025 16:52:38 +0000 (09:52 -0700)
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.

Signed-off-by: Ross Burton <ross.burton@arm.com>
meta/recipes-devtools/clang/common-clang.inc
meta/recipes-devtools/clang/libcxx_git.bb
meta/recipes-devtools/clang/lld_git.bb

index ca3a3a08b48b7fc0e45210ae5d8de6fea102e1de..f7b7a1cf9a031c6486e20785b953547e833af8e3 100644 (file)
@@ -44,4 +44,8 @@ def get_clang_host_arch(bb, d):
 def get_clang_target_arch(bb, d):
     return get_clang_arch(bb, d, 'TARGET_ARCH')
 
+# Don't put build-time RPATHs in the binaries, whilst they'll be stripped on
+# install they cause non-deterministic binaries.
+EXTRA_OECMAKE += "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON"
+
 require common.inc
index b0ee3925f4341f7bd981e0e4a0b7de6773db42d3..c630bd973eab985b96133dfd525e1576eb848892 100644 (file)
@@ -77,7 +77,6 @@ EXTRA_OECMAKE += "\
                   -DLLVM_RUNTIME_TARGETS=${HOST_ARCH} \
                   -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \
                   -DLLVM_APPEND_VC_REV=OFF \
-                  -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
 "
 
 EXTRA_OECMAKE:append:class-target = " \
index b0261ad2cb60005acc3d375028a21ca52a0c261e..ba369427909d0ab9f6e463a6f661906eabbb10a5 100644 (file)
@@ -14,13 +14,9 @@ DEPENDS = "llvm-tblgen-native llvm"
 
 OECMAKE_SOURCEPATH = "${S}/lld"
 
-# Explicitly disable RPATHs as otherwise they're stipped out of the binaries,
-# and are then non-reproducible.
-#
 # Explicitly enable symlinks as the lld build doesn't call into the llvm setup
 # and turn that on.
-EXTRA_OECMAKE += "-DCMAKE_SKIP_BUILD_RPATH=ON \
-                  -DLLVM_INCLUDE_TESTS=OFF -DLLVM_USE_SYMLINKS=ON \
+EXTRA_OECMAKE += "-DLLVM_INCLUDE_TESTS=OFF -DLLVM_USE_SYMLINKS=ON \
                   -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen"
 
 BBCLASSEXTEND = "native nativesdk"