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)
This commit is contained in:

committed by
Todd Gamblin

parent
cd185c3d28
commit
b29eb4212e
@@ -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.
|
||||
|
Reference in New Issue
Block a user