[Lldb-commits] [lldb] [lldb] Use the right MinGW name for the Python DLLs (PR #201325)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Jun 3 04:41:03 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Martin Storsjö (mstorsjo)
<details>
<summary>Changes</summary>
In MinGW mode, the Python DLLs have different names than they have in MSVC mode; they are named `libpython<major>.<minor>.dll` (a "lib" prefix and a dot between major and minor) and `libpython3.dll`.
This avoids a warning on startup after
142ad481b6254104a51da7d636ad9e3f30518a32 and total failures to start up after 3eb13f8db39ed42827122489c830c414cb6660e3.
---
Full diff: https://github.com/llvm/llvm-project/pull/201325.diff
1 Files Affected:
- (modified) lldb/CMakeLists.txt (+15-5)
``````````diff
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 89d96cfcba9e3..48544505c203b 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -100,12 +100,22 @@ if (LLDB_ENABLE_PYTHON)
if(WIN32)
# On Windows, FindPython3 doesn't reliably expose the runtime DLL path,
# only the import library. CPython's DLL naming is standard, though:
- # python3.dll for the limited API, otherwise python<MAJOR><MINOR>.dll.
- if(LLDB_ENABLE_PYTHON_LIMITED_API)
- set(LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME "python${Python3_VERSION_MAJOR}.dll")
+ # python3.dll for the limited API, otherwise python<MAJOR><MINOR>.dll,
+ # and libpython3.dll and libpython<MAJOR>.<MINOR>.dll in MinGW mode.
+ if(MINGW)
+ if(LLDB_ENABLE_PYTHON_LIMITED_API)
+ set(LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME "libpython${Python3_VERSION_MAJOR}.dll")
+ else()
+ set(LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME
+ "libpython${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}.dll")
+ endif()
else()
- set(LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME
- "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}.dll")
+ if(LLDB_ENABLE_PYTHON_LIMITED_API)
+ set(LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME "python${Python3_VERSION_MAJOR}.dll")
+ else()
+ set(LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME
+ "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}.dll")
+ endif()
endif()
message(STATUS "LLDB Python runtime DLL: ${LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME} "
"(Python3_VERSION=${Python3_VERSION}, "
``````````
</details>
https://github.com/llvm/llvm-project/pull/201325
More information about the lldb-commits
mailing list