Skip to content

Commit 380d412

Browse files
committed
[Linux][Build] Use host swiftrt.o when in HOSTTOOLS mode.
When we're building with host tools, we should use the host's swiftrt.o and not the one we've just built when we're trying to build tools that we will run on the host system. rdar://115774613
1 parent 1d05e33 commit 380d412

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)
543543
get_filename_component(swift_bin_dir ${SWIFT_EXEC_FOR_SWIFT_MODULES} DIRECTORY)
544544
get_filename_component(swift_dir ${swift_bin_dir} DIRECTORY)
545545
set(host_lib_dir "${swift_dir}/lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
546+
set(swiftrt "${host_lib_dir}/${SWIFT_HOST_VARIANT_ARCH}/swiftrt.o")
546547
547548
target_link_libraries(${target} PRIVATE ${swiftrt})
548549
target_link_libraries(${target} PRIVATE "swiftCore")

0 commit comments

Comments
 (0)