macOS: CMake may generate invalid static libraries using Clang
When llvm-ar
is available in PATH
, CMake will prefer that over ar
(assuming a LLVM based toolchain IIRC). On Darwin platforms, there is no llvm-ar
available by default so this is unlikely to occur. However, should it occur, the use of a different librarian causes issues as llvm-ar
does not generate a symbol table which ld64
deems cromulent. Attempting to link with the resulting library will fail with an obscure error message:
ld: warning: ignoring file ..., building for macOS-x86_64 but attempting to link with file built for macOS-x86_64
Ideally, we should be using libtool
to generate the static library on Darwin as that is the officially supported librarian in cctools.
Edited by Brad King