llvm-project
llvm-project copied to clipboard
Only no-op ld64.lld on Apple hosts
Following #8119, invoking ld64.lld results in the error This version of lld does not support linking for platform [macOS/iOS/...].
The rationale behind the original change was to make sure people don't accidentally use lld instead of dyld's ld64 on macOS, given that new macOS toolchains ship with lld for linking ELF binaries. However, this had the unintended effect of also making it impossible to cross-compile MachO binaries on Linux hosts with the Swift toolchain — a use case that is otherwise fully possible with Swift SDKs.
This PR updates the patch such that we only abort when linking Darwin binaries on Apple host platforms.
@swift-ci test
heya @kubamracek, would be awesome if you could take a look at this! really hope we can land this in time to be cherry-picked into 6.1