Add implicit rpaths to compiler detection (#7153)

Uses code from CMake to detect implicit link paths from compilers
System paths are filtered out of implicit link paths
Implicit link paths added to compiler config and object under `implicit_rpaths`
Implicit link paths added as rpaths to compile line through env/cc wrapper

Authored by: "Ben Boeckel <ben.boeckel@kitware.com>"
Co-authored by: "Peter Scheibel <scheibel1@llnl.gov>"
Co-authored by: "Gregory Becker <becker33@llnl.gov>"
This commit is contained in:
Ben Boeckel
2019-08-24 09:21:45 -04:00
committed by Todd Gamblin
parent a7e9f477fc
commit c22a145344
21 changed files with 384 additions and 8 deletions

6
lib/spack/env/cc vendored
View File

@@ -426,6 +426,12 @@ case "$mode" in
rpaths+=("${extra_rpaths[@]}")
fi
# Set implicit RPATHs
IFS=':' read -ra implicit_rpaths <<< "$SPACK_COMPILER_IMPLICIT_RPATHS"
if [[ "$add_rpaths" != "false" ]] ; then
rpaths+=("${implicit_rpaths[@]}")
fi
# Add SPACK_LDLIBS to args
for lib in "${SPACK_LDLIBS[@]}"; do
libs+=("${lib#-l}")