This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Warn about -mios-version-min instead of erroring out when targeting MachO embedded architectures
ClosedPublic

Authored by ahatanak on Jul 12 2023, 2:41 PM.

Details

Summary

Sometimes users pass this option when targeting embedded architectures like armv7m on non-darwin platforms.

Emit a warning instead of erroring out, which restores the behavior prior to 34d7acd444b88342fc93fca202608c1e16fa5946.

Diff Detail

Event Timeline

ahatanak created this revision.Jul 12 2023, 2:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2023, 2:41 PM
ahatanak requested review of this revision.Jul 12 2023, 2:41 PM
MaskRay accepted this revision.Jul 12 2023, 6:15 PM

LGTM.

clang/test/Driver/macho-embedded.c
9

-target is deprecated since Clang 3.4 (274b6f0c87a6a1798de0a68135afc7f95def6277). Use --target= for new tests?

-fdriver-only may be slightly better than -### as -fdriver-only causes clang to return with non-zero upon an error, while -### doesn't.

This revision is now accepted and ready to land.Jul 12 2023, 6:15 PM
MaskRay added inline comments.Jul 12 2023, 11:30 PM
clang/test/Driver/macho-embedded.c
16

Without the change, this may fail for some vendors and this is the reason that some tests have -no-canonical-prefixes (I have cleaned up a lot). For errors and warnings, we usually don't test the string before error/warning anyway.

ahatanak closed this revision.Jul 13 2023, 6:48 AM
ahatanak marked 2 inline comments as done.