Compare commits

...

5 Commits

Author SHA1 Message Date
David Abdurachmanov 0dbd84f2ef
Disable LTO on riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2024-03-28 12:39:38 +02:00
Tom Stellard a0db04f273 18.1.1 Release 2024-03-13 00:17:15 +00:00
Tom Stellard ca4b58d415 18.1.0-rc4 Release 2024-02-28 20:05:12 +00:00
Fedora Release Engineering 8b98226bfb Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-25 04:28:26 +00:00
Fedora Release Engineering f235939cfb Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-21 06:04:30 +00:00
4 changed files with 23 additions and 174 deletions

View File

@ -1,74 +0,0 @@
From ed87035da34be675df7ea78bdf5f7631d81ab2db Mon Sep 17 00:00:00 2001
From: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
Date: Wed, 25 Oct 2023 10:48:53 -0300
Subject: [PATCH] [lldb] Adapt code to Python 3.13
1. Remove usage of PyEval_ThreadsInitialized and PyEval_InitThreads
Both of these functions were removed in Python 3.13 [1] after being
deprecated since Python 3.9.
According to "What's new in Python 3.13" document [1]:
Since Python 3.7, Py_Initialize() always creates the GIL: calling
PyEval_InitThreads() did nothing and PyEval_ThreadsInitialized()
always returned non-zero.
2. Replace _Py_IsFinalizing() with Py_IsFinalizing().
[1] https://docs.python.org/3.13/whatsnew/3.13.html
---
.../ScriptInterpreter/Python/PythonDataObjects.cpp | 4 +++-
.../ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 9 +++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
index 9ac840a4a102..fe3438c42471 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -71,7 +71,9 @@ Expected<std::string> python::As<std::string>(Expected<PythonObject> &&obj) {
}
static bool python_is_finalizing() {
-#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 7
+#if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 13) || (PY_MAJOR_VERSION > 3)
+ return Py_IsFinalizing();
+#elif PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 7
return _Py_Finalizing != nullptr;
#else
return _Py_IsFinalizing();
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index a57c8e4984ad..968cc8ca0300 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -179,18 +179,27 @@ private:
return;
#endif
+// `PyEval_ThreadsInitialized` was deprecated in Python 3.9 and removed in
+// Python 3.13. It has been returning `true` always since Python 3.7.
+#if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 9) || (PY_MAJOR_VERSION < 3)
if (PyEval_ThreadsInitialized()) {
+#endif
Log *log = GetLog(LLDBLog::Script);
m_was_already_initialized = true;
m_gil_state = PyGILState_Ensure();
LLDB_LOGV(log, "Ensured PyGILState. Previous state = {0}locked\n",
m_gil_state == PyGILState_UNLOCKED ? "un" : "");
+
+// `PyEval_InitThreads` was deprecated in Python 3.9 and removed in
+// Python 3.13.
+#if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 9) || (PY_MAJOR_VERSION < 3)
return;
}
// InitThreads acquires the GIL if it hasn't been called before.
PyEval_InitThreads();
+#endif
}
PyGILState_STATE m_gil_state = PyGILState_UNLOCKED;
--
2.41.0

View File

@ -1,91 +0,0 @@
From 16fd09f102eff20825847e32f225715960d1c082 Mon Sep 17 00:00:00 2001
From: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
Date: Wed, 25 Oct 2023 10:48:53 -0300
Subject: [PATCH] [lldb] Replace the usage of module imp with module importlib
imp got removed in Python 3.12 [1] and the community recommends using
importlib in newer Python versions.
[1] https://docs.python.org/3.12/whatsnew/3.12.html#imp
---
lldb/scripts/use_lldb_suite.py | 30 ++++++++++++++++++++++--------
lldb/test/API/use_lldb_suite.py | 29 +++++++++++++++++++++--------
2 files changed, 43 insertions(+), 16 deletions(-)
diff --git a/lldb/scripts/use_lldb_suite.py b/lldb/scripts/use_lldb_suite.py
index 6388d87b181c..4cedfa532cf9 100644
--- a/lldb/scripts/use_lldb_suite.py
+++ b/lldb/scripts/use_lldb_suite.py
@@ -17,10 +17,25 @@ def find_lldb_root():
return lldb_root
lldb_root = find_lldb_root()
-import imp
-fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root])
-try:
- imp.load_module("use_lldb_suite_root", fp, pathname, desc)
-finally:
- if fp:
- fp.close()
+
+# Module imp got removed in Python 3.12.
+if (
+ sys.version_info.major == 3 and sys.version_info.minor >= 12
+) or sys.version_info.major > 3:
+ import importlib.machinery
+ import importlib.util
+
+ path = os.path.join(lldb_root, "use_lldb_suite_root.py")
+ loader = importlib.machinery.SourceFileLoader("use_lldb_suite_root", path)
+ spec = importlib.util.spec_from_loader("use_lldb_suite_root", loader=loader)
+ module = importlib.util.module_from_spec(spec)
+ loader.exec_module(module)
+else:
+ import imp
+
+ fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root])
+ try:
+ imp.load_module("use_lldb_suite_root", fp, pathname, desc)
+ finally:
+ if fp:
+ fp.close()
diff --git a/lldb/test/API/use_lldb_suite.py b/lldb/test/API/use_lldb_suite.py
index e237dd4b8a56..c9332d9921b4 100644
--- a/lldb/test/API/use_lldb_suite.py
+++ b/lldb/test/API/use_lldb_suite.py
@@ -20,11 +20,24 @@ def find_lldb_root():
lldb_root = find_lldb_root()
-import imp
-
-fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root])
-try:
- imp.load_module("use_lldb_suite_root", fp, pathname, desc)
-finally:
- if fp:
- fp.close()
+# Module imp got removed in Python 3.12.
+if (
+ sys.version_info.major == 3 and sys.version_info.minor >= 12
+) or sys.version_info.major > 3:
+ import importlib.machinery
+ import importlib.util
+
+ path = os.path.join(lldb_root, "use_lldb_suite_root.py")
+ loader = importlib.machinery.SourceFileLoader("use_lldb_suite_root", path)
+ spec = importlib.util.spec_from_loader("use_lldb_suite_root", loader=loader)
+ module = importlib.util.module_from_spec(spec)
+ loader.exec_module(module)
+else:
+ import imp
+
+ fp, pathname, desc = imp.find_module("use_lldb_suite_root", [lldb_root])
+ try:
+ imp.load_module("use_lldb_suite_root", fp, pathname, desc)
+ finally:
+ if fp:
+ fp.close()
--
2.41.0

View File

@ -4,13 +4,13 @@
# https://bugzilla.redhat.com/show_bug.cgi?id=2158587
%undefine _include_frame_pointers
%global lldb_version 17.0.6
%global lldb_version 18.1.1
#global rc_ver 4
%global lldb_srcdir %{name}-%{lldb_version}%{?rc_ver:rc%{rc_ver}}.src
Name: lldb
Version: %{lldb_version}%{?rc_ver:~rc%{rc_ver}}
Release: 1%{?dist}
Release: 1.0.riscv64%{?dist}
Summary: Next generation high-performance debugger
License: Apache-2.0 WITH LLVM-exception OR NCSA
@ -19,11 +19,6 @@ Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{lldb_v
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{lldb_version}%{?rc_ver:-rc%{rc_ver}}/%{lldb_srcdir}.tar.xz.sig
Source2: release-keys.asc
# Backport from https://github.com/llvm/llvm-project/pull/70443
Patch: 0001-lldb-Replace-the-usage-of-module-imp-with-module-imp.patch
# Backport from https://github.com/llvm/llvm-project/pull/70445
Patch: 0001-lldb-Adapt-code-to-Python-3.13.patch
BuildRequires: clang
BuildRequires: cmake
BuildRequires: ninja-build
@ -76,7 +71,11 @@ The package contains the LLDB Python module.
%autosetup -n %{lldb_srcdir} -p2
%build
%ifnarch riscv64
%global _lto_cflags -flto=thin
%else
%global _lto_cflags %{nil}
%endif
%cmake -GNinja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
@ -139,6 +138,21 @@ rm -f %{buildroot}%{python3_sitearch}/six.*
%{python3_sitearch}/lldb
%changelog
* Thu Mar 28 2024 David Abdurachmanov <davidlt@rivosinc.com> - 18.1.1-1.0.riscv64
- Disable LTO on riscv64
* Tue Mar 12 2024 Tom Stellard <tstellar@redhat.com> - 18.1.1-1
- 18.1.1 Release
* Wed Feb 28 2024 Tom Stellard <tstellar@redhat.com> - 18.1.0~rc4-1
- 18.1.0-rc4 Release
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 17.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 17.0.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Nov 29 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.6-1
- Update to LLVM 17.0.6

View File

@ -1,2 +1,2 @@
SHA512 (lldb-17.0.6.src.tar.xz) = 80b327c89b160b1dcdbea1946a7c69514e797056629c0a7501c77e7557d6bb3a7ae6ecdd0d760d072b1f7c3f5b136838f76c8d75522cd84622a03b1b25ba6e6c
SHA512 (lldb-17.0.6.src.tar.xz.sig) = d6f8edabc7d4d3ec1f7620c6166606abef4632e10f36244a8e5b76d66a94f1218742c86cd6445c7983353fc001d307709659709e9708a82c7a7042495492d9da
SHA512 (lldb-18.1.1.src.tar.xz) = 8ded185c2599ad11705de4d0f304a78065ae2a9463ab5b00af009c062315cbcd9ee3a06135195fd3b1b9b56cc77836b81c4a67c3ea0385d0c927aa415d62b02f
SHA512 (lldb-18.1.1.src.tar.xz.sig) = c360539c5e6f84caa7217d5c66eda1ffd762ef17cc41ccfce6435313f8f720b89bc52f43437e637e5808fb1c4150e2fc5f55890a198448198f5809574b5dcf11