[Driver][X86] Reject unsupported value for -mabi=
authorFangrui Song <i@maskray.me>
Fri, 26 May 2023 16:52:57 +0000 (09:52 -0700)
committerFangrui Song <i@maskray.me>
Fri, 26 May 2023 16:52:57 +0000 (09:52 -0700)
commit4a16f65fc83df494318ced1d894f6b1e562d330c
tree1cfbdab3b8d919eef5f227ad267be0e88a96dbf5
parent6ce34c089bf6806a40359b0ecaba7ffbfc809a7d
[Driver][X86] Reject unsupported value for -mabi=

-mabi= was incorrectly claimed before D134671. -mabi=sysv appears to be
somewhat common in open-source packages, even if it was not intended to
be supported by Clang.
(For common options supported by multiple architectures, it's easy to
forget to report an error on unsupported targets. Unfortunately
the driver infrastructure doesn't make this less error-prone.)

On x86, support -mabi=sysv for non-Windows targets and -mabi=ms for Windows,
and remove the spurious -Wunused-command-line-argument warning.

With this change, all popular architectures claim -mabi=, so we don't
have to worry much about -Wunused-command-line-argument for other
architectures.

Differential Revision: https://reviews.llvm.org/D151509
clang/lib/Driver/ToolChains/Arch/X86.cpp
clang/test/Driver/mabi.c [deleted file]
clang/test/Driver/x86-mabi.c [new file with mode: 0644]