summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2020-12-04 18:29:55 +0100
committerGitHub <noreply@github.com>2020-12-04 12:29:55 -0500
commit984ae7e6952072982d3197a570b18765ab264c70 (patch)
tree5a9396e2e87615d7b05a7cba9da46a664e0e1622 /lib
parent8b74b50cff03e584844de82225e7ae9e46addbcc (diff)
downloadspack-984ae7e6952072982d3197a570b18765ab264c70.tar.gz
spack-984ae7e6952072982d3197a570b18765ab264c70.tar.bz2
spack-984ae7e6952072982d3197a570b18765ab264c70.tar.xz
spack-984ae7e6952072982d3197a570b18765ab264c70.zip
Also allow --rpath as rpath linker flags (#18473)
Diffstat (limited to 'lib')
-rwxr-xr-xlib/spack/env/cc10
-rw-r--r--lib/spack/spack/test/cc.py7
2 files changed, 13 insertions, 4 deletions
diff --git a/lib/spack/env/cc b/lib/spack/env/cc
index 5efe015c9e..3300d6781a 100755
--- a/lib/spack/env/cc
+++ b/lib/spack/env/cc
@@ -320,9 +320,13 @@ while [ -n "$1" ]; do
if [ -z "$arg" ]; then shift; arg="$1"; fi
if [[ "$arg" = -rpath=* ]]; then
rp="${arg#-rpath=}"
+ elif [[ "$arg" = --rpath=* ]]; then
+ rp="${arg#--rpath=}"
elif [[ "$arg" = -rpath,* ]]; then
rp="${arg#-rpath,}"
- elif [[ "$arg" = -rpath ]]; then
+ elif [[ "$arg" = --rpath,* ]]; then
+ rp="${arg#--rpath,}"
+ elif [[ "$arg" =~ ^-?-rpath$ ]]; then
shift; arg="$1"
if [[ "$arg" != -Wl,* ]]; then
die "-Wl,-rpath was not followed by -Wl,*"
@@ -339,7 +343,9 @@ while [ -n "$1" ]; do
if [ -z "$arg" ]; then shift; arg="$1"; fi
if [[ "$arg" = -rpath=* ]]; then
rp="${arg#-rpath=}"
- elif [[ "$arg" = -rpath ]]; then
+ elif [[ "$arg" = --rpath=* ]]; then
+ rp="${arg#--rpath=}"
+ elif [[ "$arg" = -rpath ]] || [[ "$arg" = --rpath ]]; then
shift; arg="$1"
if [[ "$arg" != -Xlinker,* ]]; then
die "-Xlinker,-rpath was not followed by -Xlinker,*"
diff --git a/lib/spack/spack/test/cc.py b/lib/spack/spack/test/cc.py
index 7b8d34fbde..b719286f84 100644
--- a/lib/spack/spack/test/cc.py
+++ b/lib/spack/spack/test/cc.py
@@ -28,6 +28,7 @@ test_args = [
'-Wl,--end-group',
'-Xlinker', '-rpath', '-Xlinker', '/third/rpath',
'-Xlinker', '-rpath', '-Xlinker', '/fourth/rpath',
+ '-Wl,--rpath,/fifth/rpath', '-Wl,--rpath', '-Wl,/sixth/rpath',
'-llib3', '-llib4',
'arg5', 'arg6']
@@ -45,11 +46,13 @@ test_library_paths = [
test_wl_rpaths = [
'-Wl,-rpath,/first/rpath', '-Wl,-rpath,/second/rpath',
- '-Wl,-rpath,/third/rpath', '-Wl,-rpath,/fourth/rpath']
+ '-Wl,-rpath,/third/rpath', '-Wl,-rpath,/fourth/rpath',
+ '-Wl,-rpath,/fifth/rpath', '-Wl,-rpath,/sixth/rpath']
test_rpaths = [
'-rpath', '/first/rpath', '-rpath', '/second/rpath',
- '-rpath', '/third/rpath', '-rpath', '/fourth/rpath']
+ '-rpath', '/third/rpath', '-rpath', '/fourth/rpath',
+ '-rpath', '/fifth/rpath', '-rpath', '/sixth/rpath']
test_args_without_paths = [
'arg1',