Skip to content

[6.0 🍒][CMake] Disable use of in-process 'libSwiftScan' queries when building the Standard Library #77630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion stdlib/public/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@ elseif(SWIFT_PRIMARY_VARIANT_SDK STREQUAL "WINDOWS")
list(APPEND swift_core_private_link_libraries shell32;DbgHelp;Synchronization)
endif()

# There is a race condition with building the 'tools' CMake build of the compiler,
# which produces libSwiftScan that the compiler building the standard library may attempt to use.
# Since the current build system makes establishing this dependency relationship exceedingly difficult,
# we attempt to work around it by disabling use of 'libSwiftScan' here.
list(APPEND swift_stdlib_compile_flags "-nonlib-dependency-scanner")
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
list(APPEND swift_stdlib_compile_flags "-Xllvm" "-sil-inline-generics")
list(APPEND swift_stdlib_compile_flags "-Xllvm" "-sil-partial-specialization")
Expand Down Expand Up @@ -439,7 +444,7 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
GYB_SOURCES ${SWIFTLIB_EMBEDDED_GYB_SOURCES}
SWIFT_COMPILE_FLAGS
${swift_stdlib_compile_flags} -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding -enable-experimental-feature Embedded
-Xfrontend -enable-ossa-modules
-Xfrontend -enable-ossa-modules -nonlib-dependency-scanner
MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded"
SDK "embedded"
ARCHITECTURE "${arch}"
Expand Down