mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-30 18:29:37 -06:00
BinUtils: Restore llvm-ar fallback on Apple platforms
Since commit29ea94e17c(BinUtils: Avoid llvm-ar on Apple platforms, 2022-03-03, v3.21.6~1^2) we do not consider `llvm-ar` at all on Apple platforms. However, there are existing cross-compiling use cases in which the toolchain has `llvm-ar` but not `ar`. Prior to the re-ordering in commitcf82300a63(BinUtils: Clarify search logic and make it more consistent, 2021-05-27, v3.21.0-rc1~119^2~2), we preferred `ar` and then `llvm-ar`. Restore the original order for Apple. Fixes: #23320
This commit is contained in:
@@ -173,8 +173,13 @@ else()
|
||||
else()
|
||||
list(PREPEND _CMAKE_LINKER_NAMES "ld.lld")
|
||||
endif()
|
||||
if(NOT APPLE)
|
||||
if(APPLE)
|
||||
# llvm-ar does not generate a symbol table that the Apple ld64 linker accepts.
|
||||
# FIXME(#23333): We still need to consider 'llvm-ar' as a fallback because
|
||||
# the 'APPLE' definition may be based on the host in this context, and a
|
||||
# cross-compiling toolchain may not have 'ar'.
|
||||
list(APPEND _CMAKE_AR_NAMES "llvm-ar")
|
||||
else()
|
||||
list(PREPEND _CMAKE_AR_NAMES "llvm-ar")
|
||||
endif()
|
||||
list(PREPEND _CMAKE_RANLIB_NAMES "llvm-ranlib")
|
||||
|
||||
Reference in New Issue
Block a user