Page MenuHomePhabricator

[Driver][X86] Reject unsupported value for -mabi=
ClosedPublic

Authored by MaskRay on Thu, May 25, 3:30 PM.

Details

Summary

-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.

Diff Detail

Event Timeline

MaskRay created this revision.Thu, May 25, 3:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptThu, May 25, 3:30 PM
MaskRay requested review of this revision.Thu, May 25, 3:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptThu, May 25, 3:30 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
pengfei added inline comments.Thu, May 25, 8:31 PM
clang/test/Driver/x86-mabi.c
7

What's the expected result for e.g. x86_64-pc-windows-gnu/mingw/cygnus ?

MaskRay added inline comments.Thu, May 25, 9:58 PM
clang/test/Driver/x86-mabi.c
7

They use -mabi=ms, but I feel it's excessive to test all combinations.
(I think *windows-cygnus triples are likely dead.)

pengfei accepted this revision.Thu, May 25, 10:34 PM

LGTM.

clang/test/Driver/x86-mabi.c
7

Agreed, just want to double confirm it. Thanks!

This revision is now accepted and ready to land.Thu, May 25, 10:34 PM
This revision was landed with ongoing or failed builds.Fri, May 26, 9:53 AM
This revision was automatically updated to reflect the committed changes.