Skip to content

Commit 4258a92

Browse files
authored
Merge pull request #3313 from augusto2112/load-system-libswiftcore
[lldb] Load system's libswiftCore and honor explicit settings on REPL
2 parents e091bab + 9a7f2fa commit 4258a92

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ lldb::REPLSP SwiftREPL::CreateInstanceFromDebugger(Status &err,
195195
launch_info.SetExecutableFile(exe_module_sp->GetPlatformFileSpec(), true);
196196
}
197197

198+
launch_info.GetEnvironment() = target_sp->GetTargetEnvironment();
198199
debugger.SetAsyncExecution(false);
199200
err = target_sp->Launch(launch_info, nullptr);
200201
debugger.SetAsyncExecution(true);

lldb/tools/repl/swift/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ int main() {
5757
#endif
5858
#ifdef __APPLE__
5959
// Force loading of libswiftCore.dylib, which is not linked at build time.
60-
dlopen("@rpath/libswiftCore.dylib", RTLD_LAZY);
60+
// We load the system's libswiftCore, but this is overriden on tests to
61+
// use the just built one by setting DYLD_LIBRARY_PATH.
62+
dlopen("/usr/lib/swift/libswiftCore.dylib", RTLD_LAZY);
6163
#elif defined(__linux__)
6264
dlopen("libswiftCore.so", RTLD_LAZY);
6365
#elif defined(_WIN32)

0 commit comments

Comments
 (0)