Skip to content

BinUtils: Avoid the 'ld.lld' ELF linker on Apple platforms

Carlo Cabrera requested to merge carlocab/cmake:apple-no-lld into master

ld.lld is an ELF linker, so we should never set CMAKE_LINKER to this when on an Apple platform.

CMAKE_LINKER appears scantly used, so this does not seem to affect very many projects.

One example where this can cause problems is when building LLVM's Compiler-RT. One of their scripts uses CMAKE_LINKER to detect the supported architectures:

https://github.com/llvm/llvm-project/blob/98f6a56f5ea2fc4ae7f4283b97073667a9e32cde/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake#L89

Thus, one can end up with a slightly misconfigured build whenever CMake finds an ld.lld next to clang.

Topic-rename: binutils-apple-no-lld

Edited by Brad King

Merge request reports