summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-03-07 01:08:08 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2016-03-07 01:48:26 -0800
commit547933e7e4997a175bf03363b5c0cf7e687f2000 (patch)
tree3017e003cc0422345430feab3f72f6fb56c91136 /lib
parentf2bcc6cc357ddb52cb4f9a69dbcee83c6c0f55fb (diff)
downloadspack-547933e7e4997a175bf03363b5c0cf7e687f2000.tar.gz
spack-547933e7e4997a175bf03363b5c0cf7e687f2000.tar.bz2
spack-547933e7e4997a175bf03363b5c0cf7e687f2000.tar.xz
spack-547933e7e4997a175bf03363b5c0cf7e687f2000.zip
Fix bug in -Xlinker argument handling
- also update test to match.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/spack/env/cc15
-rw-r--r--lib/spack/spack/test/cc.py2
2 files changed, 9 insertions, 8 deletions
diff --git a/lib/spack/env/cc b/lib/spack/env/cc
index 5e6ed93985..a19346ce97 100755
--- a/lib/spack/env/cc
+++ b/lib/spack/env/cc
@@ -199,19 +199,20 @@ while [ -n "$1" ]; do
other_args+=("-Wl,$arg")
fi
;;
- -Xlinker,*)
- arg="${1#-Xlinker,}"
- if [ -z "$arg" ]; then shift; arg="$1"; fi
+ -Xlinker)
+ shift; arg="$1";
if [[ $arg = -rpath=* ]]; then
rpaths+=("${arg#-rpath=}")
elif [[ $arg = -rpath ]]; then
shift; arg="$1"
- if [[ $arg != -Xlinker,* ]]; then
- die "-Xlinker,-rpath was not followed by -Xlinker,*"
+ if [[ $arg != -Xlinker ]]; then
+ die "-Xlinker -rpath was not followed by -Xlinker <arg>"
fi
- rpaths+=("${arg#-Xlinker,}")
+ shift; arg="$1"
+ rpaths+=("$arg")
else
- other_args+=("-Xlinker,$arg")
+ other_args+=("-Xlinker")
+ other_args+=("$arg")
fi
;;
*)
diff --git a/lib/spack/spack/test/cc.py b/lib/spack/spack/test/cc.py
index 11420ec44a..f3f6d4a22e 100644
--- a/lib/spack/spack/test/cc.py
+++ b/lib/spack/spack/test/cc.py
@@ -43,7 +43,7 @@ test_command = [
'-llib1', '-llib2',
'arg4',
'-Wl,--end-group',
- '-Xlinker,-rpath', '-Xlinker,/third/rpath', '-Xlinker,-rpath', '-Xlinker,/fourth/rpath',
+ '-Xlinker', '-rpath', '-Xlinker', '/third/rpath', '-Xlinker', '-rpath', '-Xlinker', '/fourth/rpath',
'-llib3', '-llib4',
'arg5', 'arg6']