Skip to content

Commit 801b970

Browse files
committed
[Build] Fix dependency problems when bootstrapping.
If we're bootstrapping *and* skip-early-swiftsyntax is enabled, the build can fail while trying to build target executables because we haven't built a copy of libswiftCore yet but *the compiler* refers to it. This is "fixed" in other places by setting LD_LIBRARY_PATH, but we don't want or need to do that here; we just want to delay building these executables until after libswiftCore is available. rdar://116485713
1 parent 042ccdd commit 801b970

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2976,13 +2976,21 @@ function(add_swift_target_executable name)
29762976
"-${SWIFT_SDK_${sdk}_LIB_SUBDIR}"
29772977
SWIFTEXE_TARGET_DEPENDS_with_suffix)
29782978

2979+
# Note: we add ${swiftexe_link_libraries_targets} to the DEPENDS
2980+
# below because when --bootstrapping=bootstrapping with
2981+
# skip-early-swiftsyntax, the build system builds the Swift compiler
2982+
# but not the standard library during the bootstrap, and then when
2983+
# it tries to build swift-backtrace it fails because *the compiler*
2984+
# refers to a libswiftCore.so that can't be found.
2985+
29792986
_add_swift_target_executable_single(
29802987
${VARIANT_NAME}
29812988
${SWIFTEXE_TARGET_NOSWIFTRT_keyword}
29822989
${SWIFTEXE_TARGET_SOURCES}
29832990
DEPENDS
29842991
${SWIFTEXE_TARGET_DEPENDS_with_suffix}
29852992
${swiftexe_module_dependency_targets}
2993+
${swiftexe_link_libraries_targets}
29862994
SDK "${sdk}"
29872995
ARCHITECTURE "${arch}"
29882996
COMPILE_FLAGS

0 commit comments

Comments
 (0)