Skip to content

Commit c653d2d

Browse files
committed
[CMake] Always use builder's runtime for building Swift code in Linux
Some non-stdlib thing e.g. swift-backtrace still might be built before the runtime is built. For building Swift code in Linux "hosttools", always set 'LD_LIBRARY_PATH' to the runtime in the builder. (cherry picked from commit 0aa0aac) (cherry picked from commit 274ea1e)
1 parent f52cc2f commit c653d2d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,10 @@ function(_compile_swift_files
799799
set(swift_compiler_tool "${SWIFT_SOURCE_DIR}/utils/check-incremental" "${swift_compiler_tool}")
800800
endif()
801801

802-
if(SWIFTFILE_IS_STDLIB)
802+
if(SWIFTFILE_IS_STDLIB OR
803+
# Linux "hosttools" build require builder's runtime before building the runtime.
804+
(BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS" AND SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|ANDROID|OPENBSD|FREEBSD")
805+
)
803806
get_bootstrapping_swift_lib_dir(bs_lib_dir "${SWIFTFILE_BOOTSTRAPPING}")
804807
if(bs_lib_dir)
805808
# When building the stdlib with bootstrapping, the compiler needs

0 commit comments

Comments
 (0)