uutils-coreutils: remove TMPDIR from build output
PATCH 1/1 uutils-coreutils: remove TMPDIR from build output
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.
--- .../recipes-core/uutils-coreutils/uutils-coreutils_0.0.28.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.28.bb +2 -2
@@ -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} "