From a4d159cbae972249b26f91ae45ce9afe87bdfcb1 Mon Sep 17 00:00:00 2001 From: Charles Zablit Date: Fri, 2 May 2025 18:16:06 +0100 Subject: [PATCH 1/3] [windows] fix flaky linker error when building LLDB --- lldb/source/API/CMakeLists.txt | 3 --- lldb/source/Plugins/Language/Swift/CMakeLists.txt | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt index 794c032012154..05f8860a65b08 100644 --- a/lldb/source/API/CMakeLists.txt +++ b/lldb/source/API/CMakeLists.txt @@ -152,9 +152,6 @@ add_lldb_library(liblldb SHARED ${option_framework} lldbValueObject lldbVersion ${LLDB_ALL_PLUGINS} -## BEGIN SWIFT - ${SWIFT_ALL_LIBS} -## END SWIFT LINK_COMPONENTS Support diff --git a/lldb/source/Plugins/Language/Swift/CMakeLists.txt b/lldb/source/Plugins/Language/Swift/CMakeLists.txt index 78cc8db0e8811..9605588cc7160 100644 --- a/lldb/source/Plugins/Language/Swift/CMakeLists.txt +++ b/lldb/source/Plugins/Language/Swift/CMakeLists.txt @@ -27,6 +27,7 @@ add_lldb_library(lldbPluginSwiftLanguage PLUGIN lldbPluginTypeSystemSwift swiftAST swiftClangImporter + swiftCore clangAST LINK_COMPONENTS From 23213eebd81697731e86d1e1d7f16f76a08635d3 Mon Sep 17 00:00:00 2001 From: Charles Zablit Date: Fri, 2 May 2025 19:11:21 +0100 Subject: [PATCH 2/3] fixup! [windows] fix flaky linker error when building LLDB --- lldb/source/Plugins/Language/Swift/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lldb/source/Plugins/Language/Swift/CMakeLists.txt b/lldb/source/Plugins/Language/Swift/CMakeLists.txt index 9605588cc7160..ac7cfb89a613c 100644 --- a/lldb/source/Plugins/Language/Swift/CMakeLists.txt +++ b/lldb/source/Plugins/Language/Swift/CMakeLists.txt @@ -1,5 +1,11 @@ set(LLVM_NO_RTTI 1) +set(SWIFT_CORE_LIB) + +if(WIN32) + list(APPEND SWIFT_CORE_LIB swiftCore) +endif() + add_lldb_library(lldbPluginSwiftLanguage PLUGIN FoundationValueTypes.cpp LogChannelSwift.cpp @@ -27,7 +33,7 @@ add_lldb_library(lldbPluginSwiftLanguage PLUGIN lldbPluginTypeSystemSwift swiftAST swiftClangImporter - swiftCore + ${SWIFT_CORE_LIB} # fixes a linker issue when building on Windows. clangAST LINK_COMPONENTS From a715cc149da40e12506c469687c790baa9fd9dd9 Mon Sep 17 00:00:00 2001 From: Charles Zablit Date: Tue, 6 May 2025 10:41:21 +0100 Subject: [PATCH 3/3] make comment more explicit --- lldb/source/Plugins/Language/Swift/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lldb/source/Plugins/Language/Swift/CMakeLists.txt b/lldb/source/Plugins/Language/Swift/CMakeLists.txt index ac7cfb89a613c..e80a158891db9 100644 --- a/lldb/source/Plugins/Language/Swift/CMakeLists.txt +++ b/lldb/source/Plugins/Language/Swift/CMakeLists.txt @@ -33,7 +33,9 @@ add_lldb_library(lldbPluginSwiftLanguage PLUGIN lldbPluginTypeSystemSwift swiftAST swiftClangImporter - ${SWIFT_CORE_LIB} # fixes a linker issue when building on Windows. + ${SWIFT_CORE_LIB} # Fix for a build error when linking lib/liblldb.lib on Windows: 'unresolved external symbol __imp_swift_addNewDSOImage referenced in function "void __cdecl swift_image_constructor(void)"' + # The symbol is present in the file but cannot be resolved. + # This is a temporary workaround. clangAST LINK_COMPONENTS