[oe-commits] [openembedded-core] 09/37: classes/cmake: Use relative RPATHs

git at git.openembedded.org git at git.openembedded.org
Mon Nov 25 22:09:15 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 44e77d3f97af4cd4ad8bc0984f093a116a830986
Author: Joshua Watt <jpewhacker at gmail.com>
AuthorDate: Thu Nov 21 10:59:11 2019 -0600

    classes/cmake: Use relative RPATHs
    
    In most cases, the RPATH is stripped out when the ELF file is packages,
    but by then the damage is done from a reproducible perspective because
    this absolute path is hashed as part of the build-id generated at link
    time ([1] has a good explanation). Fortunately, newer cmake has an
    option to generated relative RPATHs that use $ORIGIN to set the path, so
    set it in the toolchain file.
    
    [1]: https://gitlab.kitware.com/cmake/cmake/issues/18413
    
    Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/cmake.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 291f1e8..8ccb1ee 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -120,6 +120,9 @@ set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf )
 # directory as rpath by default
 set( CMAKE_INSTALL_RPATH ${OECMAKE_RPATH} )
 
+# Use RPATHs relative to build directory for reproducibility
+set( CMAKE_BUILD_RPATH_USE_ORIGIN ON )
+
 # Use our cmake modules
 list(APPEND CMAKE_MODULE_PATH "${STAGING_DATADIR}/cmake/Modules/")
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list