#16032·meson

Support other linkers on MacOS

Author: theoparisCreated Jul 22, 2026Updated Sep 21, 2026
LabelsenhancementOS:macosdynamic linkers

Currently meson hard codes ld to be the linker for swift binaries: https://github.com/mesonbuild/meson/blob/1ad63886b559e397925c50d111a2516ea5b3c8b2/mesonbuild/linkers/detect.py#L233-L257

meson.build:1:0: ERROR: Unable to detect linker for compiler `swiftc -use-ld=lld -Xlinker --version /var/folders/65/llvxcv4146qbqh5jnpllm1880000gn/T/tmpv5cisu4o.swift -o /dev/null`
stdout:
stderr: LLD 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
# native.txt
[binaries]
swift = ['swiftc', '-use-ld=lld']

See also https://github.com/mesonbuild/meson/pull/16070 - there's experimental MachO support in wild but I don't think that this PR handles it for MacOS?