This is an archive of the discontinued LLVM Phabricator instance.

[clang][darwin] Add support for the -mtargetos= option to the driver
ClosedPublic

Authored by arphaman on Jul 19 2021, 2:46 PM.

Details

Summary

The new -mtargetos= option is a replacement for the existing, OS-specific options like -miphoneos-version-min=. This allows us to introduce support for new darwin OSes easier as they won't require the use of a new option. The older options will be deprecated and the use of the new option will be encouraged instead.

This patch depends on https://reviews.llvm.org/D105960

Diff Detail

Event Timeline

arphaman created this revision.Jul 19 2021, 2:46 PM

Looks good in general. Just one corner case that we need to decide with direction we go, following command builds arm64-ios and x86_64-ios-simulator:
clang -arch arm64 -arch x86_64 -c -o test.o test.c -mios-version-min=14
Should we document and deprecate that behavior?

Looks good in general. Just one corner case that we need to decide with direction we go, following command builds arm64-ios and x86_64-ios-simulator:
clang -arch arm64 -arch x86_64 -c -o test.o test.c -mios-version-min=14
Should we document and deprecate that behavior?

Yes this can be documented and deprecated, but I can do this in a follow-up commit. We do want to try to remove the inferring of the simulator from the x86_64 arch, but I don't think we can do that just yet, although I haven't tested this recently.

steven_wu accepted this revision.Jul 29 2021, 8:17 PM
This revision is now accepted and ready to land.Jul 29 2021, 8:17 PM
This revision was landed with ongoing or failed builds.Aug 2 2021, 12:45 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2021, 12:45 PM