Skip to content

Commit 0aa0aac

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.
1 parent f645069 commit 0aa0aac

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
@@ -801,7 +801,10 @@ function(_compile_swift_files
801801
set(swift_compiler_tool "${SWIFT_SOURCE_DIR}/utils/check-incremental" "${swift_compiler_tool}")
802802
endif()
803803

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

0 commit comments

Comments
 (0)