cc: work around -v split between ld and ccld (#42111)
This commit is contained in:
parent
0f920a85e4
commit
c508ff1e5f
2 changed files with 11 additions and 2 deletions
11
lib/spack/env/cc
vendored
11
lib/spack/env/cc
vendored
|
@ -283,10 +283,19 @@ esac
|
|||
if [ -z "$mode" ] || [ "$mode" = ld ]; then
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
-v|-V|--version|-dumpversion)
|
||||
-V|--version|-dumpversion)
|
||||
mode=vcheck
|
||||
break
|
||||
;;
|
||||
-v)
|
||||
# NOTE(trws): -v is verbose on gcc, not version, this is an ld-mode flag only
|
||||
# -V is invalid on gcc but may be valid on some other compiler so leaving that in
|
||||
case "$mode" in
|
||||
ld)
|
||||
mode=vcheck
|
||||
break
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
|
|
@ -244,10 +244,10 @@ def test_no_wrapper_environment():
|
|||
def test_vcheck_mode(wrapper_environment):
|
||||
assert dump_mode(cc, ["-I/include", "--version"]) == "vcheck"
|
||||
assert dump_mode(cc, ["-I/include", "-V"]) == "vcheck"
|
||||
assert dump_mode(cc, ["-I/include", "-v"]) == "vcheck"
|
||||
assert dump_mode(cc, ["-I/include", "-dumpversion"]) == "vcheck"
|
||||
assert dump_mode(cc, ["-I/include", "--version", "-c"]) == "vcheck"
|
||||
assert dump_mode(cc, ["-I/include", "-V", "-o", "output"]) == "vcheck"
|
||||
assert dump_mode(ld, ["-I/include", "-v"]) == "vcheck"
|
||||
|
||||
|
||||
def test_cpp_mode(wrapper_environment):
|
||||
|
|
Loading…
Reference in a new issue