Also allow --rpath as rpath linker flags (#18473)
This commit is contained in:
parent
8b74b50cff
commit
984ae7e695
2 changed files with 13 additions and 4 deletions
10
lib/spack/env/cc
vendored
10
lib/spack/env/cc
vendored
|
@ -320,9 +320,13 @@ while [ -n "$1" ]; do
|
||||||
if [ -z "$arg" ]; then shift; arg="$1"; fi
|
if [ -z "$arg" ]; then shift; arg="$1"; fi
|
||||||
if [[ "$arg" = -rpath=* ]]; then
|
if [[ "$arg" = -rpath=* ]]; then
|
||||||
rp="${arg#-rpath=}"
|
rp="${arg#-rpath=}"
|
||||||
|
elif [[ "$arg" = --rpath=* ]]; then
|
||||||
|
rp="${arg#--rpath=}"
|
||||||
elif [[ "$arg" = -rpath,* ]]; then
|
elif [[ "$arg" = -rpath,* ]]; then
|
||||||
rp="${arg#-rpath,}"
|
rp="${arg#-rpath,}"
|
||||||
elif [[ "$arg" = -rpath ]]; then
|
elif [[ "$arg" = --rpath,* ]]; then
|
||||||
|
rp="${arg#--rpath,}"
|
||||||
|
elif [[ "$arg" =~ ^-?-rpath$ ]]; then
|
||||||
shift; arg="$1"
|
shift; arg="$1"
|
||||||
if [[ "$arg" != -Wl,* ]]; then
|
if [[ "$arg" != -Wl,* ]]; then
|
||||||
die "-Wl,-rpath was not followed by -Wl,*"
|
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 [ -z "$arg" ]; then shift; arg="$1"; fi
|
||||||
if [[ "$arg" = -rpath=* ]]; then
|
if [[ "$arg" = -rpath=* ]]; then
|
||||||
rp="${arg#-rpath=}"
|
rp="${arg#-rpath=}"
|
||||||
elif [[ "$arg" = -rpath ]]; then
|
elif [[ "$arg" = --rpath=* ]]; then
|
||||||
|
rp="${arg#--rpath=}"
|
||||||
|
elif [[ "$arg" = -rpath ]] || [[ "$arg" = --rpath ]]; then
|
||||||
shift; arg="$1"
|
shift; arg="$1"
|
||||||
if [[ "$arg" != -Xlinker,* ]]; then
|
if [[ "$arg" != -Xlinker,* ]]; then
|
||||||
die "-Xlinker,-rpath was not followed by -Xlinker,*"
|
die "-Xlinker,-rpath was not followed by -Xlinker,*"
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
'-Wl,--end-group',
|
'-Wl,--end-group',
|
||||||
'-Xlinker', '-rpath', '-Xlinker', '/third/rpath',
|
'-Xlinker', '-rpath', '-Xlinker', '/third/rpath',
|
||||||
'-Xlinker', '-rpath', '-Xlinker', '/fourth/rpath',
|
'-Xlinker', '-rpath', '-Xlinker', '/fourth/rpath',
|
||||||
|
'-Wl,--rpath,/fifth/rpath', '-Wl,--rpath', '-Wl,/sixth/rpath',
|
||||||
'-llib3', '-llib4',
|
'-llib3', '-llib4',
|
||||||
'arg5', 'arg6']
|
'arg5', 'arg6']
|
||||||
|
|
||||||
|
@ -45,11 +46,13 @@
|
||||||
|
|
||||||
test_wl_rpaths = [
|
test_wl_rpaths = [
|
||||||
'-Wl,-rpath,/first/rpath', '-Wl,-rpath,/second/rpath',
|
'-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 = [
|
test_rpaths = [
|
||||||
'-rpath', '/first/rpath', '-rpath', '/second/rpath',
|
'-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 = [
|
test_args_without_paths = [
|
||||||
'arg1',
|
'arg1',
|
||||||
|
|
Loading…
Reference in a new issue