Skip to content

Commit c12b0a5

Browse files
authored
Merge pull request #14306 from davezarzycki/speculative_apple_lld_fix
[build system] Speculative Apple lld fix
2 parents fedbd53 + 9529a7d commit c12b0a5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ function(_add_variant_link_flags)
405405

406406
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
407407
find_program(LDLLD_PATH "ld.lld")
408-
if((SWIFT_ENABLE_LLD_LINKER AND LDLLD_PATH) OR
408+
# Strangely, macOS finds lld and then can't find it when using -fuse-ld=
409+
if((SWIFT_ENABLE_LLD_LINKER AND LDLLD_PATH AND NOT APPLE) OR
409410
("${LFLAGS_SDK}" STREQUAL "WINDOWS" AND
410411
NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WINDOWS"))
411412
list(APPEND result "-fuse-ld=lld")

cmake/modules/AddSwiftUnittests.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ function(add_swift_unittest test_dirname)
4848
endif()
4949

5050
find_program(LDLLD_PATH "ld.lld")
51-
if(SWIFT_ENABLE_LLD_LINKER AND LDLLD_PATH)
51+
# Strangely, macOS finds lld and then can't find it when using -fuse-ld=
52+
if(SWIFT_ENABLE_LLD_LINKER AND LDLLD_PATH AND NOT APPLE)
5253
set_property(TARGET "${test_dirname}" APPEND_STRING PROPERTY
5354
LINK_FLAGS " -fuse-ld=lld")
5455
elseif(SWIFT_ENABLE_GOLD_LINKER AND

0 commit comments

Comments
 (0)