SwiftCompilerSources: workaround a crash in the LoadableByAddress pass when building on Windows

This commit is contained in:
Erik Eckstein
2024-04-25 11:07:36 +02:00
parent 7bf193e764
commit 338dd185e7

View File

@@ -172,6 +172,10 @@ function(add_swift_compiler_modules_library name)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
list(APPEND swift_compile_options "-static")
list(APPEND sdk_option "-sdk" "${SWIFT_PATH_TO_SWIFT_SDK}")
# Workaround a crash in the LoadableByAddress pass
# https://github.com/apple/swift/issues/73254
list(APPEND swift_compile_options "-Xllvm" "-sil-disable-pass=loadable-address")
else()
list(APPEND sdk_option "-I" "${swift_exec_bin_dir}/../lib" "-I" "${sdk_path}/usr/lib")
endif()