[PATCH] D115415: [clang][macho] add clang frontend support for emitting macho files with two build version load commands

Alex Lorenz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 8 17:54:17 PST 2021


arphaman created this revision.
arphaman added reviewers: ravikandhadai, dexonsmith, steven_wu.
Herald added subscribers: dang, ributzka, hiraditya.
arphaman requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch extends clang frontend to add metadata that can be used to emit macho files with two build version load commands.
It utilizes "darwin.target_variant.triple" and "darwin.target_variant.SDK Version" metadata names for that.

MachO uses two build version load commands to represent an object file / binary that is targeting both the macOS target,
and the Mac Catalyst target. At runtime, a dynamic library that supports both targets can be loaded from either a native
macOS or a Mac Catalyst app on a macOS system. We want to add support to this to upstream to LLVM to be able to build
compiler-rt for both targets, to finish the complete support for the Mac Catalyst platform, which is right now targetable
by upstream clang, but the compiler-rt bits aren't supported because of the lack of this multiple build version support.

      

Follow-up to https://reviews.llvm.org/D112189, I'm working on final two patches, to add clang driver support, and change compiler-rt to build with target variant.


https://reviews.llvm.org/D115415

Files:
  clang/include/clang/Basic/TargetInfo.h
  clang/include/clang/Basic/TargetOptions.h
  clang/include/clang/Driver/Options.td
  clang/lib/Basic/Targets.cpp
  clang/lib/CodeGen/ModuleBuilder.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/CodeGen/darwin-target-variant.c
  llvm/include/llvm/IR/Module.h
  llvm/lib/IR/Module.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115415.393004.patch
Type: text/x-patch
Size: 8427 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211209/c0c4eb31/attachment.bin>


More information about the llvm-commits mailing list