Skip to content

Commit bc4c425

Browse files
committed
Link more compatibility libraries when cross compiling
Those may be needed when cross-compiling x86_64 when building on Apple Silicon Supports rdar://90307965
1 parent f5787c9 commit bc4c425

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,10 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)
466466
# This requires to explicitly add all the needed compatibility libraries. We
467467
# can take them from the current build.
468468
set(vsuffix "-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH}")
469-
set(conctarget "swiftCompatibilityConcurrency${vsuffix}")
470-
target_link_libraries(${target} PUBLIC ${conctarget})
469+
foreach(compat_library IN ITEMS "Concurrency" "DynamicReplacements" "50" "51")
470+
set(conctarget "swiftCompatibility${compat_library}${vsuffix}")
471+
target_link_libraries(${target} PUBLIC ${conctarget})
472+
endforeach()
471473
472474
# Add the SDK directory for the host platform.
473475
target_link_directories(${target} PRIVATE "${sdk_dir}")

tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ function(add_sourcekitd_swifrt_linking target path HAS_SWIFT_MODULES)
5252
# This requires to explicitly add all the needed compatibility libraries. We
5353
# can take them from the current build.
5454
set(vsuffix "-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH}")
55-
set(conctarget "swiftCompatibilityConcurrency${vsuffix}")
56-
target_link_libraries(${target} PUBLIC ${conctarget})
55+
foreach(compat_library IN ITEMS "Concurrency" "DynamicReplacements" "50" "51")
56+
set(conctarget "swiftCompatibility${compat_library}${vsuffix}")
57+
target_link_libraries(${target} PUBLIC ${conctarget})
58+
endforeach()
5759

5860
# Add the SDK directory for the host platform.
5961
target_link_directories(${target} PRIVATE "${sdk_dir}")

0 commit comments

Comments
 (0)