]> code.ossystems Code Review - openembedded-core.git/commitdiff
gcc-cross.inc: Process binaries in build dir to be relocatable
authorNathan Rossi <nathan@nathanrossi.com>
Wed, 11 Sep 2019 14:13:07 +0000 (14:13 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 11 Sep 2019 14:28:55 +0000 (15:28 +0100)
Process binaries within the build directory before stashing to be
relocatable with ORIGIN relative rpaths. This corrects issues with
rpaths being invalid when trying to use the binaries from an unstashed
build directory (e.g. gcc-runtime).

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/gcc/gcc-cross.inc

index 95af6d89a9dd0f3e018fc249e28a28a43c3694a5..8855bb1f34a8bc4826b6bc94520d85956c3b0d3d 100644 (file)
@@ -206,9 +206,17 @@ do_package_write_ipk[noexec] = "1"
 do_package_write_rpm[noexec] = "1"
 do_package_write_deb[noexec] = "1"
 
-BUILDDIRSTASH = "${WORKDIR}/stashed-builddir"
+inherit chrpath
+
+python gcc_stash_builddir_fixrpaths() {
+    # rewrite rpaths, breaking hardlinks as required
+    process_dir("/", d.getVar("BUILDDIRSTASH"), d, break_hardlinks = True)
+}
+
+BUILDDIRSTASH = "${WORKDIR}/stashed-builddir/build"
 do_gcc_stash_builddir[dirs] = "${B}"
 do_gcc_stash_builddir[cleandirs] = "${BUILDDIRSTASH}"
+do_gcc_stash_builddir[postfuncs] += "gcc_stash_builddir_fixrpaths"
 do_gcc_stash_builddir () {
        dest=${BUILDDIRSTASH}
        hardlinkdir . $dest