Only convert -L<path> to -Wl,-rpath,<path> in compiler scripts if <path> points into the spack install area

This specifically fixes problems with building gcc, as build and system directories were turning in in gcc library rpaths.
This commit is contained in:
Matthew LeGendre 2015-03-27 13:58:57 -07:00
parent af92250c7e
commit a4cce9eb69
2 changed files with 5 additions and 1 deletions

2
lib/spack/env/cc vendored
View File

@ -262,7 +262,7 @@ done
# Include all -L's and prefix/whatever dirs in rpath # Include all -L's and prefix/whatever dirs in rpath
for dir in "${libraries[@]}"; do for dir in "${libraries[@]}"; do
[ "$dir" != "." ] && rpaths+=("$dir") [[ dir = $SPACK_INSTALL* ]] && rpaths+=("$dir")
done done
rpaths+=("$SPACK_PREFIX/lib") rpaths+=("$SPACK_PREFIX/lib")
rpaths+=("$SPACK_PREFIX/lib64") rpaths+=("$SPACK_PREFIX/lib64")

View File

@ -52,6 +52,7 @@
SPACK_ENV_PATH = 'SPACK_ENV_PATH' SPACK_ENV_PATH = 'SPACK_ENV_PATH'
SPACK_DEPENDENCIES = 'SPACK_DEPENDENCIES' SPACK_DEPENDENCIES = 'SPACK_DEPENDENCIES'
SPACK_PREFIX = 'SPACK_PREFIX' SPACK_PREFIX = 'SPACK_PREFIX'
SPACK_INSTALL = 'SPACK_INSTALL'
SPACK_DEBUG = 'SPACK_DEBUG' SPACK_DEBUG = 'SPACK_DEBUG'
SPACK_SHORT_SPEC = 'SPACK_SHORT_SPEC' SPACK_SHORT_SPEC = 'SPACK_SHORT_SPEC'
SPACK_DEBUG_LOG_DIR = 'SPACK_DEBUG_LOG_DIR' SPACK_DEBUG_LOG_DIR = 'SPACK_DEBUG_LOG_DIR'
@ -125,6 +126,9 @@ def set_build_environment_variables(pkg):
# Install prefix # Install prefix
os.environ[SPACK_PREFIX] = pkg.prefix os.environ[SPACK_PREFIX] = pkg.prefix
# Install root prefix
os.environ[SPACK_INSTALL] = spack.install_path
# Remove these vars from the environment during build becaus they # Remove these vars from the environment during build becaus they
# can affect how some packages find libraries. We want to make # can affect how some packages find libraries. We want to make
# sure that builds never pull in unintended external dependencies. # sure that builds never pull in unintended external dependencies.