Skip to content

Commit

Permalink
Provide a minimum OS version (11) for ARM/macOS
Browse files Browse the repository at this point in the history
This gives LLVM enough information to generate a
"platform load-command" in the MachO object file.

Fixes #7941
  • Loading branch information
alexreinking committed Jun 25, 2024
1 parent 8c836b3 commit e4d7c75
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/LLVM_Runtime_Linker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,10 @@ llvm::Triple get_triple_for_target(const Target &target) {
triple.setOS(llvm::Triple::Fuchsia);
} else if (target.os == Target::OSX) {
triple.setVendor(llvm::Triple::Apple);
triple.setOS(llvm::Triple::MacOSX);
// Setting a minimum OS version here enables LLVM to include platform
// metadata in the MachO object file. Without this, Xcode 15's ld
// issues warnings about missing the "platform load command".
triple.setOSName("macos11");
triple.setArchName("arm64");
} else if (target.os == Target::NoOS) {
// For bare-metal environments
Expand Down

0 comments on commit e4d7c75

Please sign in to comment.