Compare commits

...

24 Commits

Author SHA1 Message Date
David Abdurachmanov e74d3ded7a
Merge remote-tracking branch 'up/main' into main-riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2023-12-07 19:55:00 +02:00
Tulio Magno Quites Machado Filho abea627cd8 Add patches in order to work with Python 3.12 and 3.13 2023-11-30 13:56:04 -03:00
Tulio Magno Quites Machado Filho 6476637d55 Remove unused patches
These patches have been removed from the spec file, but remained in the
repo.
2023-11-30 13:56:04 -03:00
Tulio Magno Quites Machado Filho a4a9a8b957 Update to LLVM 17.0.6 2023-11-29 10:08:51 -03:00
David Abdurachmanov 1494c5ab42
Disable LTO on riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2023-11-07 12:28:08 +02:00
Tulio Magno Quites Machado Filho 104f63963a Update to LLVM 17.0.4 2023-11-01 19:46:31 -03:00
Tulio Magno Quites Machado Filho fa80d6c05b Update to LLVM 17.0.3 2023-10-18 09:41:21 -03:00
Tulio Magno Quites Machado Filho 65aefd6f4f Update to LLVM 17.0.2 2023-10-05 08:10:22 -03:00
Tulio Magno Quites Machado Filho 3871817aca Add missing sources 2023-09-26 14:27:08 -03:00
Tulio Magno Quites Machado Filho 10464485d4 Update to LLVM 17.0.1
Manually set CLANG_RESOURCE_DIR based on the rpm macros in order to
avoid using a path that depends on LLVM_LIBDIR_SUFFIX, which is not used
anymore since 2ad36cffbc3fe9169c3c86fa794159841aae9dd0.
2023-09-25 16:06:50 -03:00
Tulio Magno Quites Machado Filho f61239e69a Update to LLVM 17.0.0 RC4 2023-09-11 13:22:58 -03:00
Tulio Magno Quites Machado Filho 6e06ac19ec Update to LLVM 17.0.0 RC3 2023-08-25 18:03:04 -03:00
Tulio Magno Quites Machado Filho 33fc35ad79 Update to LLVM 17.0.0 RC2 2023-08-23 13:54:26 -03:00
Tulio Magno Quites Machado Filho c44bcea462 Update to LLVM 17.0.0 RC1 2023-08-10 13:56:46 -03:00
Tulio Magno Quites Machado Filho 185d6dc8bf Fix rpmlint warning
Remove an unnecessary extra space.
2023-07-25 10:37:55 -03:00
Fedora Release Engineering 3d4f17c7d3 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-20 12:54:24 +00:00
Tulio Magno Quites Machado Filho eb471c1f59 Update to LLVM 16.0.6 2023-07-10 11:49:12 -03:00
Python Maint 99a6a93262 Rebuilt for Python 3.12 2023-06-16 11:20:52 +02:00
Nikita Popov 5ee5e40709 Use llvm-cmake-utils package 2023-06-15 17:01:15 +02:00
Python Maint a27264cd1e Rebuilt for Python 3.12 2023-06-15 14:41:12 +02:00
Tulio Magno Quites Machado Filho 258023a1f4 Update to LLVM 16.0.5 2023-06-06 11:49:42 -03:00
Tulio Magno Quites Machado Filho abb02063eb Update to LLVM 16.0.4 2023-05-19 18:56:55 -03:00
Tulio Magno Quites Machado Filho 4a8c57b3d9 Update to LLVM 16.0.3 2023-05-10 15:14:40 -03:00
Tulio Magno Quites Machado Filho 13e8e6c63d Update to LLVM 16.0.2 2023-04-26 18:54:27 -03:00
5 changed files with 238 additions and 38 deletions

View File

@ -0,0 +1,74 @@
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,30 +0,0 @@
From fb389f0cd6b4e8996157fa7d7bc347fde7b43656 Mon Sep 17 00:00:00 2001
From: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
Date: Thu, 23 Mar 2023 16:06:10 -0300
Subject: [PATCH] [lldb] Change LLVM_COMMON_CMAKE_UTILS usage
Let LLVM_COMMON_CMAKE_UTILS store the directory where cmake modules are
available and stop assuming its directory structure.
---
lldb/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 20d584c48bad..7bad2a9928cd 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -1,9 +1,9 @@
cmake_minimum_required(VERSION 3.13.4)
if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
- set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
+ set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules)
endif()
-include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
+include(${LLVM_COMMON_CMAKE_UTILS}/CMakePolicy.cmake
NO_POLICY_SCOPE)
# Add path for custom modules.
--
2.39.2

View File

@ -0,0 +1,91 @@
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 16.0.1
%global lldb_version 17.0.6
#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,13 +19,17 @@ 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
Patch0: 0001-lldb-Change-LLVM_COMMON_CMAKE_UTILS-usage.patch
# 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
BuildRequires: llvm-devel = %{version}
BuildRequires: llvm-test = %{version}
BuildRequires: llvm-cmake-utils = %{version}
BuildRequires: clang-devel = %{version}
BuildRequires: ncurses-devel
BuildRequires: swig
@ -72,15 +76,18 @@ 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 \
%cmake -GNinja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_SKIP_RPATH:BOOL=ON \
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-DLLVM_CONFIG:FILEPATH=/usr/bin/llvm-config-%{__isa_bits} \
-DLLVM_COMMON_CMAKE_UTILS=%{_libdir}/cmake/llvm/ \
\
-DLLVM_COMMON_CMAKE_UTILS=%{_datadir}/llvm/cmake \
-DLLDB_DISABLE_CURSES:BOOL=OFF \
-DLLDB_DISABLE_LIBEDIT:BOOL=OFF \
-DLLDB_DISABLE_PYTHON:BOOL=OFF \
@ -95,6 +102,7 @@ The package contains the LLDB Python module.
-DPYTHON_VERSION_MINOR:STRING=$(%{__python3} -c "import sys; print(sys.version_info.minor)") \
-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
-DCLANG_LINK_CLANG_DYLIB=ON \
-DCLANG_RESOURCE_DIR=$(realpath --relative-to=/usr/bin %{clang_resource_dir}) \
-DLLVM_LIT_ARGS="-sv \
--path %{_libdir}/llvm" \
@ -135,6 +143,63 @@ rm -f %{buildroot}%{python3_sitearch}/six.*
%{python3_sitearch}/lldb
%changelog
* Thu Dec 07 2023 David Abdurachmanov <davidlt@rivosinc.com> - 17.0.6-1.0.riscv64
- Disable LTO on riscv64
* Wed Nov 29 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.6-1
- Update to LLVM 17.0.6
* Wed Nov 01 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.4-1
- Update to LLVM 17.0.4
* Wed Oct 18 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.3-1
- Update to LLVM 17.0.3
* Wed Oct 04 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.2-1
- Update to LLVM 17.0.2
* Mon Sep 25 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.1-1
- Update to LLVM 17.0.1
* Mon Sep 11 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.0~rc4-1
- Update to LLVM 17.0.0 RC4
* Fri Aug 25 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.0~rc3-1
- Update to LLVM 17.0.0 RC3
* Wed Aug 23 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.0~rc2-1
- Update to LLVM 17.0.0 RC2
* Wed Aug 02 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.0~rc1-1
- Update to LLVM 17.0.0 RC1
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 16.0.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Mon Jul 10 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.6-1
- Update to LLVM 16.0.6
* Fri Jun 16 2023 Python Maint <python-maint@redhat.com> - 16.0.5-4
- Rebuilt for Python 3.12
* Thu Jun 15 2023 Nikita Popov <npopov@redhat.com> - 16.0.5-3
- Use llvm-cmake-utils package
* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 16.0.5-2
- Rebuilt for Python 3.12
* Tue Jun 06 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.5-1
- Update to LLVM 16.0.5
* Fri May 19 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.4-1
- Update to LLVM 16.0.4
* Wed May 10 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.3-1
- Update to LLVM 16.0.3
* Wed Apr 26 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.2-1
- Update to LLVM 16.0.2
* Thu Apr 13 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.1-1
- Update to LLVM 16.0.1

View File

@ -1,2 +1,2 @@
SHA512 (lldb-16.0.1.src.tar.xz) = 1691f8b25e76fa070a3ff4a6b13675e6af9926a5b9039052969a7881f1f478777f92c214df69847d958ae67275b4ff05568420cbc39a2ed5bf8c24b436bac568
SHA512 (lldb-16.0.1.src.tar.xz.sig) = 188266bab767e9ae06dbea00f8c6068f7042a1f89cf54e800fc1c5d6db7dbeccd13f3a9580ba5240088f565b0fdd9dc89fa14f83061171f17b1c295e0c6ca45d
SHA512 (lldb-17.0.6.src.tar.xz) = 80b327c89b160b1dcdbea1946a7c69514e797056629c0a7501c77e7557d6bb3a7ae6ecdd0d760d072b1f7c3f5b136838f76c8d75522cd84622a03b1b25ba6e6c
SHA512 (lldb-17.0.6.src.tar.xz.sig) = d6f8edabc7d4d3ec1f7620c6166606abef4632e10f36244a8e5b76d66a94f1218742c86cd6445c7983353fc001d307709659709e9708a82c7a7042495492d9da