kumquat-buildroot/support
Yann E. MORIN 0209d05619 support/scripts: fix RPATH fixups
Commit a87abcf6da65 (Makefile: run PPD and RPATH fixup in host-fialize)
(sic) moved the fixups peviously done in prepare-sdk, to host-finalize.

This exposed a bug in fix-rpath, when RPATH contains multiple entries,
like:  /PPD/host-foo/host/lib:/PPD/host-foo/host/lib/foo

In that situation, we want to get rid of /PPD/host-foo and replace it
with the finale HOST_DIR, so we mangle the RPATH with a sed expression.

However, that sed expression only ever replaces the first match, as it
is missing the 'g' option. Thus, the second (and following) parts of
RPATH are still referring to the PPD, and thus patchelf does not find it
relative to the final HOST_DIR, amd rops it. This eventually lead to a
final RPATH set as $ORIGIN/../lib instead of the expected
$ORIGIN/../lib:$ORIGIN/../lib/foo

This is the case for host-systemd, which installs some of its libraries
in $PREFIX/lib/systemd/ and adds an RPATH set appropriately to
/PPD/host-systemd/host/lib:/PPD/host-systemd/host/lib/systemd and that
gets incorrectly mangled.

Fixes: https://gitlab.com/buildroot.org/buildroot/-/issues/39

Also fix a typo in the comment just above.

Reported-by: José Luis Salvador Rufo @jlsalvador
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: José Luis Salvador Rufo <salvador.joseluis@gmail.com>
Reviewed-by: José Luis Salvador Rufo <salvador.joseluis@gmail.com>
Tested-by: Adam Duskett <adam.duskett@amarulasolutions.com>
Reviewed-by: Adam Duskett <adam.duskett@amarulasolutions.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
(cherry picked from commit 2100a76d9ef620d9749352fb85f83720412598ec)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2024-10-12 15:55:44 +02:00
..
config-fragments support/config-fragments: fix bootlin-x86-i686-musl 2024-06-03 17:52:06 +02:00
dependencies support/dependencies/dependencies.sh: libopenssl needs perl bigint on s390x 2024-03-03 13:13:40 +01:00
docker support/docker: add qemu-system-misc for riscv runtime tests 2023-08-24 23:20:26 +02:00
download support/download/check-hash: accept hash files without terminating \n 2024-08-20 19:20:00 +02:00
gnuconfig
kconfig kconfig/lxdialog: fix check() with GCC14 2024-05-15 15:18:09 +02:00
legal-info boot, package, support, toolchain: switch to 2 spaces for the hash file 2022-07-28 23:05:23 +02:00
libtool
misc support/misc/Vagrantfile: support libvirt provider 2024-09-19 10:33:20 +02:00
scripts support/scripts: fix RPATH fixups 2024-10-12 15:55:44 +02:00
testing support/testing: fs: new erofs runtime test 2024-10-11 17:03:21 +02:00