summaryrefslogtreecommitdiff
path: root/lib/spack/docs/config_yaml.rst
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2019-10-23 22:22:24 +0200
committerTodd Gamblin <tgamblin@llnl.gov>2019-10-23 13:22:24 -0700
commitb29eb4212e8d9077e0c01911c5448a5900210954 (patch)
tree4b5dc4685daf49c6bfa5ce4432f18bf9f8c1985c /lib/spack/docs/config_yaml.rst
parentcd185c3d284b8086735db11e9ca77ba29f84c753 (diff)
downloadspack-b29eb4212e8d9077e0c01911c5448a5900210954.tar.gz
spack-b29eb4212e8d9077e0c01911c5448a5900210954.tar.bz2
spack-b29eb4212e8d9077e0c01911c5448a5900210954.tar.xz
spack-b29eb4212e8d9077e0c01911c5448a5900210954.zip
Users can configure use of RPATH or RUNPATH (#9168)
Add a new entry in `config.yaml`: config: shared_linking: 'rpath' If this variable is set to `rpath` (the default) Spack will set RPATH in ELF binaries. If set to `runpath` it will set RUNPATH. Details: * Spack cc wrapper explicitly adds `--disable-new-dtags` when linking * cc wrapper also strips `--enable-new-dtags` from the compile line when disabling (and vice versa) * We specifically do *not* add any dtags flags on macOS, which uses Mach-O binaries, not ELF, so there's no RUNPATH)
Diffstat (limited to 'lib/spack/docs/config_yaml.rst')
-rw-r--r--lib/spack/docs/config_yaml.rst21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/spack/docs/config_yaml.rst b/lib/spack/docs/config_yaml.rst
index 525f829c9e..d8d07b505a 100644
--- a/lib/spack/docs/config_yaml.rst
+++ b/lib/spack/docs/config_yaml.rst
@@ -226,3 +226,24 @@ ccache`` to learn more about the default settings and how to change
them). Please note that we currently disable ccache's ``hash_dir``
feature to avoid an issue with the stage directory (see
https://github.com/LLNL/spack/pull/3761#issuecomment-294352232).
+
+------------------
+``shared_linking``
+------------------
+
+Control whether Spack embeds ``RPATH`` or ``RUNPATH`` attributes in ELF binaries
+so that they can find their dependencies. Has no effect on macOS.
+Two options are allowed:
+
+ 1. ``rpath`` uses ``RPATH`` and forces the ``--disable-new-tags`` flag to be passed to the linker
+ 2. ``runpath`` uses ``RUNPATH`` and forces the ``--enable-new-tags`` flag to be passed to the linker
+
+``RPATH`` search paths have higher precedence than ``LD_LIBRARY_PATH``
+and ld.so will search for libraries in transitive ``RPATHs`` of
+parent objects.
+
+``RUNPATH`` search paths have lower precedence than ``LD_LIBRARY_PATH``,
+and ld.so will ONLY search for dependencies in the ``RUNPATH`` of
+the loading object.
+
+DO NOT MIX the two options within the same install tree.