Skip to content

Revert "lldb: link swift's libswift to lldb" #3736

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
34 changes: 0 additions & 34 deletions lldb/cmake/modules/AddLLDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -151,40 +151,6 @@ function(add_lldb_library name)
endif()
endfunction(add_lldb_library)

# BEGIN Swift Mods
function(add_properties_for_swift_modules target)
if (BOOTSTRAPPING_MODE)
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
if(BOOTSTRAPPING_MODE MATCHES "HOSTTOOLS|.*HOSTLIBS")
target_link_directories(${target} PRIVATE
"${CMAKE_OSX_SYSROOT}/usr/lib/swift"
"${LLDB_SWIFT_LIBS}/macosx")
set_property(TARGET ${target} APPEND PROPERTY INSTALL_RPATH
"/usr/lib/swift")
elseif(BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING")
target_link_directories(${target} PRIVATE "${LLDB_SWIFT_LIBS}/macosx")
set_property(TARGET ${target} APPEND PROPERTY INSTALL_RPATH
"${LLDB_SWIFT_LIBS}/macosx")
else()
message(FATAL_ERROR "Unknown BOOTSTRAPPING_MODE '${BOOTSTRAPPING_MODE}'")
endif()

# Workaround for a linker crash related to autolinking: rdar://77839981
set_property(TARGET ${target} APPEND_STRING PROPERTY
LINK_FLAGS " -lobjc ")
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
string(REGEX MATCH "^[^-]*" arch ${TARGET_TRIPLE})
target_link_libraries(${target} PRIVATE swiftCore-linux-${arch})

# TODO: add "${LLDB_SWIFT_LIBS}/linux" to BUILD_RPATH and not INSTALL_RPATH.
# This does not work for some reason.
set_property(TARGET ${target} APPEND PROPERTY INSTALL_RPATH
"${LLDB_SWIFT_LIBS}/linux;$ORIGIN/../lib/swift/linux")
endif()
endif()
endfunction()
# END Swift Mods

function(add_lldb_executable name)
cmake_parse_arguments(ARG
"GENERATE_INSTALL"
Expand Down
4 changes: 0 additions & 4 deletions lldb/source/API/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ add_lldb_library(liblldb SHARED ${option_framework}
${option_install_prefix}
)

# BEGIN Swift Mods
add_properties_for_swift_modules(liblldb)
# END Swift Mods

# lib/pythonX.Y/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so,
# which depends on lib/libLLVM*.so (BUILD_SHARED_LIBS) or lib/libLLVM-10git.so
# (LLVM_LINK_LLVM_DYLIB). Add an additional rpath $ORIGIN/../../../../lib so
Expand Down
1 change: 0 additions & 1 deletion lldb/source/Plugins/ExpressionParser/Swift/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ add_lldb_library(lldbPluginExpressionParserSwift PLUGIN
swiftSIL
swiftSILOptimizer
swiftSerialization
swiftCompilerModules
clangAST
clangBasic
clangRewrite
Expand Down
3 changes: 0 additions & 3 deletions lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "swift/AST/Module.h"
#include "swift/AST/Type.h"
#include "swift/AST/Types.h"
#include "swift/Basic/InitializeSwiftModules.h"
#include "swift/Demangling/ManglingMacros.h"
#include "llvm/Support/ConvertUTF.h"

Expand Down Expand Up @@ -80,8 +79,6 @@ void SwiftLanguage::Initialize() {
lldb_private::formatters::NSArray_Additionals::GetAdditionalSynthetics()
.emplace(g_NSArrayClass1,
lldb_private::formatters::swift::ArraySyntheticFrontEndCreator);

initializeSwiftModules();
}

void SwiftLanguage::Terminate() {
Expand Down
4 changes: 0 additions & 4 deletions lldb/tools/lldb-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ add_lldb_tool(lldb-test
Support
)

# BEGIN Swift Mods
add_properties_for_swift_modules(lldb-test)
# END Swift Mods

if(Python3_RPATH)
set_property(TARGET lldb-test APPEND PROPERTY INSTALL_RPATH "${Python3_RPATH}")
set_property(TARGET lldb-test APPEND PROPERTY BUILD_RPATH "${Python3_RPATH}")
Expand Down