This is an archive of the discontinued LLVM Phabricator instance.

[Driver][ARM] Warn about -mabi= for assembler input
ClosedPublic

Authored by MaskRay on Jun 24 2023, 12:30 AM.

Details

Summary

Previously, Clang Driver reported a warning when assembler input was assembled
with the -mabi= option. D152856 added TargetSpecific to -mabi= option and
reported an error for such a case. This change restores the previous behavior by
reporting a warning.

GCC translates -mabi={apcs-gnu,atpcs} to gas -meabi=gnu and other -mabi= values
to -meabi=5. We don't support setting e_flags to any value other than
EF_ARM_EABI_VER5.

Close https://github.com/ClangBuiltLinux/linux/issues/1878

Diff Detail

Event Timeline

MaskRay created this revision.Jun 24 2023, 12:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2023, 12:30 AM
MaskRay requested review of this revision.Jun 24 2023, 12:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2023, 12:30 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
MaskRay edited the summary of this revision. (Show Details)Jun 24 2023, 12:33 AM

The change seems OK to me in principle, but I'd appreciate the code being more self-descriptive. Thanks.

clang/lib/Driver/ToolChains/Arch/ARM.cpp
528

This comment is quite terse. Could you please expand it? Maybe something like:

// -mabi is not a supported option for the assembler.
// For GCC compatibility accept but warn.
clang/test/Driver/arm-abi.c
65

Other tests in this file begin with a one-line explanation and I think it would be good to do the same here. Maybe something like:

// The combination of -x assember & -mabi is not supported but for GCC compatibility should be accepted with a warning
MaskRay updated this revision to Diff 534668.Jun 26 2023, 11:26 AM
MaskRay marked an inline comment as done.

Thanks for the comments. Improved comments.

MaskRay marked an inline comment as done.Jun 26 2023, 11:26 AM
This revision is now accepted and ready to land.Jun 26 2023, 12:04 PM
This revision was landed with ongoing or failed builds.Jun 26 2023, 12:28 PM
This revision was automatically updated to reflect the committed changes.