[Buildroot] How to retain intentional absolute RPATH for target application?

Thomas De Schampheleire thomas.de_schampheleire at nokia.com
Wed Aug 1 14:17:13 UTC 2018


I have an application that has an RPATH containing (among some automatically
present values) an absolute path which is present on target but not a standard
search path, say /opt/foobar/lib , and also as first entry $ORIGIN/../lib.
The application is stored in /opt/foobar/bin.

Testing on target in a case where fix-rpath is not used (old buildroot version)
shows that the first entry in RPATH is used, i.e. $ORIGIN/../lib, resolving to

When going to current buildroot including fix-rpath, this application cannot be
loaded because the libraries are not found. Analysis shows that only standard
search paths are considered.

Manually checking the patchelf step shows that the RPATH is completely cleared.
I found a patch by Bryce Ferguson regarding endianness problems on PPC (this is
indeed a PPC target), but although it is applied and fixes the display of the
RPATH field in readelf after running fix-rpath, the actual issue remains:
RPATH is empty after running fix-rpath.

My question is now: how to allow preserving such an intentional RPATH, or at
least make sure that the libraries in /opt/foobar/lib are found?


More information about the buildroot mailing list