This is an archive of the discontinued LLVM Phabricator instance.

[clang][macho] Add support for -darwin-target-variant-sdk-version in cc1as
ClosedPublic

Authored by drodriguez on Oct 11 2022, 4:48 PM.

Details

Summary

D121868 provided support for -darwin-target-variant-triple, but the
support for -darwin-target-variant-sdk-version was still missing for
cc1as. These changes build upon the previous and provides such support.

  • Extracted the common code to handle -darwin-target-variant-triple and -darwin-target-variant-sdk-version in the Darwin toolchain to a method that can be used for both the cc1 and the cc1as job construction. cc1as does not support some of the parameters that were provided to cc1, so the same code cannot be used for both.
  • Invoke that new common code when constructing a cc1as invocation.
  • Parse the new -darwin-target-variant-sdk-version in the cc1as driver. Apply its value to the MCObjectFileInfo to generate the right values in the object files.
  • Includes two new tests that check that cc1as uses the provided values in -darwin-target-variant-sdk and that the Clang driver creates the jobs with the correct arguments.

Diff Detail

Event Timeline

drodriguez created this revision.Oct 11 2022, 4:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 11 2022, 4:48 PM
Herald added a subscriber: StephenFan. · View Herald Transcript
drodriguez requested review of this revision.Oct 11 2022, 4:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 11 2022, 4:48 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
arphaman accepted this revision.Oct 12 2022, 2:04 PM

Thanks, this looks good!

This revision is now accepted and ready to land.Oct 12 2022, 2:04 PM

From internal review: use virtual method in ToolChain instead of static_cast.

clang-format

This revision was landed with ongoing or failed builds.Oct 14 2022, 2:35 PM
This revision was automatically updated to reflect the committed changes.