diff mbox series

[meta-oe] uutils-coreutils: remove TMPDIR from build output

Message ID 20250126113504.679854-1-skandigraun@gmail.com
State New
Headers show
Series [meta-oe] uutils-coreutils: remove TMPDIR from build output | expand

Commit Message

Gyorgy Sarvari Jan. 26, 2025, 11:35 a.m. UTC
BUILD_LDFLAGS is primarily (but not exclusively) defined by bitbake.conf.
Beside other things, it adds STAGING_LIBDIR_NATIVE and STAGING_BASE_LIBDIR_NATIVE
as both rpath and rpath-link arguments to this variable.

Usually this shouldn't matter for class-target compilation, as it's normally
expected to use only TARGET_* variables, not BUILD_* ones.

This is not always the case with Rust - some crates are compiled for the host
target even when the recipe target is class-target, e.g. for some compiler
plugins, and I'm sure there are other reasons also. This makes some BUILD_*
variables to be used in the this process, making the rpath variables from BUILD_LDFLAGS
ending up in the final binary.

From the manpage of ld(1): "The difference between -rpath and -rpath-link is that
directories specified by -rpath options are included in	the executable and used at
runtime, whereas the -rpath-link option is only effective at link time."

Based on this, it should be safe to remove these options from BUILD_LDFLAGS:
these folders don't exist during runtime, but since they are present as rpath-link
also in BUILD_LDFLAGS, they can be still used link-time, if needed.

This allows generating reproducible binaries for this recipe.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 .../recipes-core/uutils-coreutils/uutils-coreutils_0.0.28.bb  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.28.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.28.bb
index 5608b0347..c2bc9ca34 100644
--- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.28.bb
+++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.28.bb
@@ -72,5 +72,5 @@  python __anonymous() {
         d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
 }
 
-ERROR_QA:remove = "buildpaths"
-WARN_QA:append = " buildpaths"
+BUILD_LDFLAGS:remove:class-target = " -Wl,-rpath,${STAGING_LIBDIR_NATIVE}  \
+                                      -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE} "