[Git][reproducible-builds/reproducible-website][master] deterministic_build_systems: add some CMake and RPATH notes

Peter Wu gitlab at salsa.debian.org
Fri Jan 18 20:09:14 CET 2019


Peter Wu pushed to branch master at Reproducible Builds / reproducible-website


Commits:
77d689df by Peter Wu at 2019-01-18T19:08:06Z
deterministic_build_systems: add some CMake and RPATH notes

- - - - -


1 changed file:

- _docs/deterministic_build_systems.md


Changes:

=====================================
_docs/deterministic_build_systems.md
=====================================
@@ -46,6 +46,24 @@ What follows are some advices on common issues that can affect source
 code or build systems that make multiple builds from the exact same
 source different.
 
+CMake notes
+-----------
+The default configuration of CMake makes the build directory part of the
+build environment. Here are some known issues and recommendations:
+
+ * CMake sets a `RPATH` for binaries that link to a library in the build
+   directory, containing the build directory. Even if this is stripped
+   at installation time, the build-id section will be different.
+   Possible workarounds:
+   * Set `CMAKE_BUILD_WITH_INSTALL_RPATH=ON` or `CMAKE_SKIP_RPATH=ON` to
+     ensure a deterministic RPATH. Disadvantage: programs from the build
+     directory cannot be run without setting `LD_LIBRARY_PATH`.
+   * Set
+     [`CMAKE_BUILD_RPATH_USE_ORIGIN=ON`](https://cmake.org/cmake/help/git-master/prop_tgt/BUILD_RPATH_USE_ORIGIN.html).
+     to enable the use of relative directories in RPATH (requires CMake
+     3.14). This is an appropriate option for both upstream projects
+     and downstream distributions.
+
 Disclaimer
 ----------
 



View it on GitLab: https://salsa.debian.org/reproducible-builds/reproducible-website/commit/77d689df181b9ea2691db7c134601fa38180ca22

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/reproducible-website/commit/77d689df181b9ea2691db7c134601fa38180ca22
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20190118/bfc9760b/attachment.html>


More information about the rb-commits mailing list