Revert "cc: work around -v split between ld and ccld" (#42196)

This commit is contained in:
Harmen Stoppels 2024-01-19 17:59:41 +01:00 committed by GitHub
parent c31a998abb
commit ce81175cf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 11 deletions

11
lib/spack/env/cc vendored
View File

@ -283,19 +283,10 @@ esac
if [ -z "$mode" ] || [ "$mode" = ld ]; then
for arg in "$@"; do
case $arg in
-V|--version|-dumpversion)
-v|-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

View File

@ -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):