aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2022-01-03 14:48:13 +0100
committerPavel Labath <pavel@labath.sk>2022-01-03 14:48:13 +0100
commit862fffd8231c8c44a8ea8071041eac8919aed346 (patch)
treed1bc0e8a0ddc7c4b9bf3238bbdce9474dab586ca /lldb/source/Plugins
parentca271f4ef5a2a4bf115ac11ada70bbd7c737d77d (diff)
downloadllvm-862fffd8231c8c44a8ea8071041eac8919aed346.tar.gz
llvm-862fffd8231c8c44a8ea8071041eac8919aed346.tar.bz2
llvm-862fffd8231c8c44a8ea8071041eac8919aed346.zip
[lldb/qemu] Set qemu's "ld prefix" based on the platform sysroot
Both serve the same purpose (finding shared libraries) and allow one to launch a dynamically linked executable by just specifying the platform sysroot.
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.cpp b/lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.cpp
index 84e10042a97c..dd7546d8fa15 100644
--- a/lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.cpp
+++ b/lldb/source/Plugins/Platform/QemuUser/PlatformQemuUser.cpp
@@ -191,6 +191,8 @@ lldb::ProcessSP PlatformQemuUser::DebugProcess(ProcessLaunchInfo &launch_info,
launch_info.SetArguments(args, true);
Environment emulator_env = Host::GetEnvironment();
+ if (ConstString sysroot = GetSDKRootDirectory())
+ emulator_env["QEMU_LD_PREFIX"] = sysroot.GetStringRef().str();
for (const auto &KV : GetGlobalProperties().GetEmulatorEnvVars())
emulator_env[KV.first()] = KV.second;
launch_info.GetEnvironment() = ComputeLaunchEnvironment(