!18 enable make check
From: @fly_fzc Reviewed-by: @gaoruoshu Signed-off-by: @gaoruoshu
This commit is contained in:
commit
590922abc0
58
backport-pylibfdt-fix-with-Python-3.10.patch
Normal file
58
backport-pylibfdt-fix-with-Python-3.10.patch
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
From 383e148b70a47ab15f97a19bb999d54f9c3e810f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ross Burton <ross.burton@arm.com>
|
||||||
|
Date: Thu, 11 Nov 2021 16:05:36 +0000
|
||||||
|
Subject: [PATCH] pylibfdt: fix with Python 3.10
|
||||||
|
|
||||||
|
Since Python 2.5 the argument parsing functions when parsing expressions
|
||||||
|
such as s# (string plus length) expect the length to be an int or a
|
||||||
|
ssize_t, depending on whether PY_SSIZE_T_CLEAN is defined or not.
|
||||||
|
|
||||||
|
Python 3.8 deprecated the use of int, and with Python 3.10 this symbol
|
||||||
|
must be defined and ssize_t used[1].
|
||||||
|
|
||||||
|
Define the magic symbol when building the extension, and cast the ints
|
||||||
|
from the libfdt API to ssize_t as appropriate.
|
||||||
|
|
||||||
|
[1] https://docs.python.org/3.10/whatsnew/3.10.html#id2
|
||||||
|
|
||||||
|
Signed-off-by: Ross Burton <ross.burton@arm.com>
|
||||||
|
Message-Id: <20211111160536.2516573-1-ross.burton@arm.com>
|
||||||
|
[dwg: Adjust for new location of setup.py]
|
||||||
|
Tested-by: Rob Herring <robh@kernel.org>
|
||||||
|
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
||||||
|
---
|
||||||
|
pylibfdt/libfdt.i | 4 ++--
|
||||||
|
pylibfdt/setup.py | 1 +
|
||||||
|
2 files changed, 3 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i
|
||||||
|
index 51ee801..075ef70 100644
|
||||||
|
--- a/pylibfdt/libfdt.i
|
||||||
|
+++ b/pylibfdt/libfdt.i
|
||||||
|
@@ -1044,9 +1044,9 @@ typedef uint32_t fdt32_t;
|
||||||
|
$result = Py_None;
|
||||||
|
else
|
||||||
|
%#if PY_VERSION_HEX >= 0x03000000
|
||||||
|
- $result = Py_BuildValue("y#", $1, *arg4);
|
||||||
|
+ $result = Py_BuildValue("y#", $1, (Py_ssize_t)*arg4);
|
||||||
|
%#else
|
||||||
|
- $result = Py_BuildValue("s#", $1, *arg4);
|
||||||
|
+ $result = Py_BuildValue("s#", $1, (Py_ssize_t)*arg4);
|
||||||
|
%#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/pylibfdt/setup.py b/pylibfdt/setup.py
|
||||||
|
index 4b07be9..0a0daf1 100755
|
||||||
|
--- a/pylibfdt/setup.py
|
||||||
|
+++ b/pylibfdt/setup.py
|
||||||
|
@@ -30,6 +30,7 @@ top_builddir = get_top_builddir()
|
||||||
|
libfdt_module = Extension(
|
||||||
|
'_libfdt',
|
||||||
|
sources=[os.path.join(srcdir, 'libfdt.i')],
|
||||||
|
+ define_macros=[('PY_SSIZE_T_CLEAN', None)],
|
||||||
|
include_dirs=[os.path.join(srcdir, '../libfdt')],
|
||||||
|
libraries=['fdt'],
|
||||||
|
library_dirs=[os.path.join(top_builddir, 'libfdt')],
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
9
dtc.spec
9
dtc.spec
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: dtc
|
Name: dtc
|
||||||
Version: 1.6.1
|
Version: 1.6.1
|
||||||
Release: 2
|
Release: 3
|
||||||
Summary: Device tree compiler
|
Summary: Device tree compiler
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: https://devicetree.org/
|
URL: https://devicetree.org/
|
||||||
@ -14,6 +14,7 @@ Provides: libfdt
|
|||||||
Obsoletes: libfdt
|
Obsoletes: libfdt
|
||||||
|
|
||||||
Patch1: openEuler-add-secure-compile-option-in-Makefile.patch
|
Patch1: openEuler-add-secure-compile-option-in-Makefile.patch
|
||||||
|
Patch2: backport-pylibfdt-fix-with-Python-3.10.patch
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -53,6 +54,9 @@ This package provides python3 bindings for libfdt
|
|||||||
make install DESTDIR=$RPM_BUILD_ROOT PREFIX=$RPM_BUILD_ROOT/usr \
|
make install DESTDIR=$RPM_BUILD_ROOT PREFIX=$RPM_BUILD_ROOT/usr \
|
||||||
LIBDIR=%{_libdir} BINDIR=%{_bindir} INCLUDEDIR=%{_includedir} V=1
|
LIBDIR=%{_libdir} BINDIR=%{_bindir} INCLUDEDIR=%{_includedir} V=1
|
||||||
|
|
||||||
|
%check
|
||||||
|
%make_build check
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
@ -80,6 +84,9 @@ make install DESTDIR=$RPM_BUILD_ROOT PREFIX=$RPM_BUILD_ROOT/usr \
|
|||||||
%doc Documentation/manual.txt
|
%doc Documentation/manual.txt
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu May 25 2023 fuanan <fuanan3@h-partners.com> - 1.6.1-3
|
||||||
|
- enable make check
|
||||||
|
|
||||||
* Wed Oct 26 2022 yanglongkang<yanglongkang@h-partners.com> - 1.6.1-2
|
* Wed Oct 26 2022 yanglongkang<yanglongkang@h-partners.com> - 1.6.1-2
|
||||||
- rebuild for next release
|
- rebuild for next release
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user