[PATCH] D55612: [macho] save the SDK version stored in module metadata into the version min and build version load commands in the object file

Alex Lorenz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 12 13:11:34 PST 2018


arphaman created this revision.
arphaman added reviewers: steven_wu, dexonsmith.
Herald added subscribers: jkorous, javed.absar.

This patch introduces a new metadata node called "SDK Version". It will be set by the frontend to mark the platform SDK (macOS/iOS/etc) version which was used during that particular compilation.
This node is used when machine code is emitted, by either saving the SDK version into the appropriate macho load command (version min/build version), or by emitting the assembly for these load commands with the SDK version specified as well.
The assembly for both load commands is extended by allowing it to contain the `sdk_version X, Y [, Z]` trailing directive to represent the SDK version respectively.


Repository:
  rL LLVM

https://reviews.llvm.org/D55612

Files:
  include/llvm/IR/Module.h
  include/llvm/MC/MCAssembler.h
  include/llvm/MC/MCObjectFileInfo.h
  include/llvm/MC/MCStreamer.h
  lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  lib/IR/Module.cpp
  lib/MC/MCAsmStreamer.cpp
  lib/MC/MCAssembler.cpp
  lib/MC/MCMachOStreamer.cpp
  lib/MC/MCParser/DarwinAsmParser.cpp
  lib/MC/MCStreamer.cpp
  lib/MC/MachObjectWriter.cpp
  lib/Object/ModuleSymbolTable.cpp
  test/MC/MachO/ARM/build-version-sdk-version-errors.c
  test/MC/MachO/ARM/build-version-sdk-version.s
  test/MC/MachO/build-version-with-sdk-version.s
  test/MC/MachO/darwin-sdk-version.ll
  test/MC/MachO/osx-version-min-load-command-with-sdk-errors.s
  test/MC/MachO/osx-version-min-load-command-with-sdk.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55612.177897.patch
Type: text/x-patch
Size: 27811 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181212/23d1e7cc/attachment.bin>


More information about the llvm-commits mailing list