From b54bf8ad867e0beddf0fcda6b4deacc3b6a0f7c8 Mon Sep 17 00:00:00 2001 From: Alesandro Portale Date: Tue, 12 Apr 2022 16:32:55 +0200 Subject: [PATCH] Debugger: Fix start of Android lldb from NDK 23.x on Linux In order to help lldb locate libpython3.9.so, we need to point LD_LIBRARY_PATH to the right lib/ path inside the NDK. Fixes: QTCREATORBUG-27297 Change-Id: I4c234fabf291dfb5f5240120541897a79cb6933a Reviewed-by: Christian Stenger Reviewed-by: --- src/plugins/debugger/debuggeritem.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index 4a34596e2fe..382bd6af8f2 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -290,6 +290,13 @@ bool DebuggerItem::addAndroidLldbPythonEnv(const Utils::FilePath &lldbCmd, Utils if (pythonBinDir.exists()) { env.set("PYTHONHOME", pythonDir.toUserOutput()); env.prependOrSetPath(pythonBinDir); + + if (HostOsInfo::isAnyUnixHost()) { + const FilePath pythonLibDir = pythonDir.pathAppended("lib"); + if (pythonLibDir.exists()) + env.prependOrSet("LD_LIBRARY_PATH", pythonLibDir.toString()); + } + return true; } }