[all-commits] [llvm/llvm-project] 116c1b: [clang][macho] add clang frontend support for emit...

Alex Lorenz via All-commits all-commits at lists.llvm.org
Wed Feb 2 08:30:59 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 116c1bea65ac268bc46a2373220c81d02fc0a256
      https://github.com/llvm/llvm-project/commit/116c1bea65ac268bc46a2373220c81d02fc0a256
  Author: Alex Lorenz <arphaman at gmail.com>
  Date:   2022-02-02 (Wed, 02 Feb 2022)

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

  Log Message:
  -----------
  [clang][macho] add clang frontend support for emitting macho files with two build version load commands

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.

Differential Revision: https://reviews.llvm.org/D115415




More information about the All-commits mailing list