summaryrefslogtreecommitdiffstats
path: root/meta/classes/cmake.bbclass
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2019-11-21 10:59:11 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-11-27 13:25:18 +0000
commit9582fec24abac64ce691ee482de6a4816fff6dc0 (patch)
treefcc5a79d9561010109faf869fb86c0ce37fdf9f1 /meta/classes/cmake.bbclass
parent73aaa5239268b0d2e6b6ab563b5525f62885d24d (diff)
downloadpoky-9582fec24abac64ce691ee482de6a4816fff6dc0.tar.gz
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 (From OE-Core rev: 44e77d3f97af4cd4ad8bc0984f093a116a830986) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/cmake.bbclass')
-rw-r--r--meta/classes/cmake.bbclass3
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 291f1e8d44..8ccb1eefc7 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -120,6 +120,9 @@ set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf )
120# directory as rpath by default 120# directory as rpath by default
121set( CMAKE_INSTALL_RPATH ${OECMAKE_RPATH} ) 121set( CMAKE_INSTALL_RPATH ${OECMAKE_RPATH} )
122 122
123# Use RPATHs relative to build directory for reproducibility
124set( CMAKE_BUILD_RPATH_USE_ORIGIN ON )
125
123# Use our cmake modules 126# Use our cmake modules
124list(APPEND CMAKE_MODULE_PATH "${STAGING_DATADIR}/cmake/Modules/") 127list(APPEND CMAKE_MODULE_PATH "${STAGING_DATADIR}/cmake/Modules/")
125 128