diff --git a/backport-pylibfdt-fix-with-Python-3.10.patch b/backport-pylibfdt-fix-with-Python-3.10.patch deleted file mode 100644 index 045b048c4589c8bbba923cef2a5a14c93f0e1e8f..0000000000000000000000000000000000000000 --- a/backport-pylibfdt-fix-with-Python-3.10.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 383e148b70a47ab15f97a19bb999d54f9c3e810f Mon Sep 17 00:00:00 2001 -From: Ross Burton -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 -Message-Id: <20211111160536.2516573-1-ross.burton@arm.com> -[dwg: Adjust for new location of setup.py] -Tested-by: Rob Herring -Signed-off-by: David Gibson ---- - 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 - diff --git a/dtc-1.6.1.tar.xz b/dtc-1.6.1.tar.xz deleted file mode 100644 index 52c206bbde72161ec34455c331781db0e4f4a669..0000000000000000000000000000000000000000 Binary files a/dtc-1.6.1.tar.xz and /dev/null differ diff --git a/dtc-1.7.0.tar.xz b/dtc-1.7.0.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..c974b08e6bdbff54f5ae4b3452eb112b875cae8e Binary files /dev/null and b/dtc-1.7.0.tar.xz differ diff --git a/dtc.spec b/dtc.spec index 4d3fedcdfdcc0cb7cbf7b5c4e4a868800addbded..b0c9b2954683c760ac402c7c118258e1e33c7041 100644 --- a/dtc.spec +++ b/dtc.spec @@ -1,21 +1,19 @@ %define _wrong_version_format_terminate_build 0 Name: dtc -Version: 1.6.1 -Release: 3 +Version: 1.7.0 +Release: 1 Summary: Device tree compiler License: GPLv2+ URL: https://devicetree.org/ Source0: https://www.kernel.org/pub/software/utils/%{name}/%{name}-%{version}.tar.xz BuildRequires: gcc make flex bison swig -BuildRequires: python3-devel python3-setuptools +BuildRequires: python3-devel python3-setuptools python3-setuptools_scm python3-pip python3-wheel Provides: libfdt Obsoletes: libfdt Patch1: openEuler-add-secure-compile-option-in-Makefile.patch -Patch2: backport-pylibfdt-fix-with-Python-3.10.patch - %description The devicetree is a data structure for describing hardware. Rather than hard coding @@ -48,13 +46,17 @@ This package provides python3 bindings for libfdt %autosetup -n %{name}-%{version} -p1 %build +export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %make_build + %install +export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} make install DESTDIR=$RPM_BUILD_ROOT PREFIX=$RPM_BUILD_ROOT/usr \ LIBDIR=%{_libdir} BINDIR=%{_bindir} INCLUDEDIR=%{_includedir} V=1 %check +export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %make_build check %pre @@ -66,7 +68,6 @@ make install DESTDIR=$RPM_BUILD_ROOT PREFIX=$RPM_BUILD_ROOT/usr \ %postun %files -%doc README %license GPL README.license %{_bindir}/* %{_libdir}/libfdt-%{version}.so @@ -84,6 +85,9 @@ make install DESTDIR=$RPM_BUILD_ROOT PREFIX=$RPM_BUILD_ROOT/usr \ %doc Documentation/manual.txt %changelog +* Fri Jul 14 2023 dillon chen - 1.7.0-1 +- update version to 1.7.0 + * Thu May 25 2023 fuanan - 1.6.1-3 - enable make check diff --git a/openEuler-add-secure-compile-option-in-Makefile.patch b/openEuler-add-secure-compile-option-in-Makefile.patch index 79997bf8eea9bf7ee263072b1985737343d15c1b..8806902151aba075c12334b76289ecc2bd3f0e09 100644 --- a/openEuler-add-secure-compile-option-in-Makefile.patch +++ b/openEuler-add-secure-compile-option-in-Makefile.patch @@ -18,7 +18,7 @@ index f02aa19..a37a2db 100644 +EXTRA_CFLAGS += -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wl,-z,now -fPIE +LDFLAGS += -Wl,-z,now -pie CPPFLAGS = -I libfdt -I . -DFDT_ASSUME_MASK=$(ASSUME_MASK) - WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \ + WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs -Wsign-compare \ -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow -- 2.23.0