mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 23:21:17 +02:00
sys-apps/dtc: Sync with Gentoo
It's from Gentoo commit bfafbcc5b6aaf3ea33eb905c6d44fbce586777d6.
This commit is contained in:
parent
74ad503e4b
commit
9e5e9b0743
@ -1,2 +1 @@
|
||||
DIST dtc-1.7.1.tar.xz 169524 BLAKE2B c9d9d7c60ce13c8e138ab8ddf3e8166d7cf3867ca4e5ea53621bf73514319faf6a6bac09fb96c971554db9f77dd3428e01d53990586041092a64849685d8854b SHA512 3195924b374680e367d7be6b9793691efc0441858068c8bc8d8a908db00bbae781a99184b5c5e272af39045ec58cb0f92adbdd00ff808480b635bd632aa74719
|
||||
DIST dtc-1.7.2.tar.xz 169668 BLAKE2B d345027614a4caff9912b39286e35c1a889bbfd88630bac1c9c48223a6171bd6a8661342c89355e63301b395d1c238be82d21d870b0dd5fc05ae5dd552e730a6 SHA512 30f3611175a5c29556282f3f2894701a5837eb869608d89d78c280af448bbc3a5b6c83f51c28f991847c0eb7c42aa57599bbc31433f1b3b2c8d162cb2169b91f
|
||||
|
@ -1,9 +1,9 @@
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{10..12} )
|
||||
PYTHON_COMPAT=( python3_{10..13} )
|
||||
inherit meson python-single-r1
|
||||
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
@ -11,7 +11,7 @@ if [[ ${PV} == 9999 ]] ; then
|
||||
inherit git-r3
|
||||
else
|
||||
SRC_URI="https://www.kernel.org/pub/software/utils/${PN}/${P}.tar.xz"
|
||||
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||
fi
|
||||
|
||||
DESCRIPTION="Open Firmware device tree compiler"
|
||||
@ -27,7 +27,12 @@ BDEPEND="
|
||||
app-alternatives/yacc
|
||||
app-alternatives/lex
|
||||
virtual/pkgconfig
|
||||
python? ( dev-lang/swig )
|
||||
python? (
|
||||
dev-lang/swig
|
||||
$(python_gen_cond_dep '
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
')
|
||||
)
|
||||
"
|
||||
RDEPEND="
|
||||
python? ( ${PYTHON_DEPS} )
|
||||
@ -43,6 +48,11 @@ DOCS=(
|
||||
Documentation/manual.txt
|
||||
)
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${P}-swig-4.3.patch
|
||||
"${FILESDIR}"/${P}-glibc-2.41-execstack.patch
|
||||
)
|
||||
|
||||
pkg_setup() {
|
||||
if use python ; then
|
||||
export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
|
||||
@ -64,3 +74,9 @@ src_configure() {
|
||||
|
||||
meson_src_configure
|
||||
}
|
||||
|
||||
src_install() {
|
||||
meson_src_install
|
||||
|
||||
use python && python_optimize "${ED}"
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{10..12} )
|
||||
PYTHON_COMPAT=( python3_{10..13} )
|
||||
inherit meson python-single-r1
|
||||
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
@ -11,7 +11,7 @@ if [[ ${PV} == 9999 ]] ; then
|
||||
inherit git-r3
|
||||
else
|
||||
SRC_URI="https://www.kernel.org/pub/software/utils/${PN}/${P}.tar.xz"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
|
||||
fi
|
||||
|
||||
DESCRIPTION="Open Firmware device tree compiler"
|
||||
@ -27,7 +27,12 @@ BDEPEND="
|
||||
app-alternatives/yacc
|
||||
app-alternatives/lex
|
||||
virtual/pkgconfig
|
||||
python? ( dev-lang/swig )
|
||||
python? (
|
||||
dev-lang/swig
|
||||
$(python_gen_cond_dep '
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
')
|
||||
)
|
||||
"
|
||||
RDEPEND="
|
||||
python? ( ${PYTHON_DEPS} )
|
||||
|
@ -1,9 +1,9 @@
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{10..12} )
|
||||
PYTHON_COMPAT=( python3_{10..13} )
|
||||
inherit meson python-single-r1
|
||||
|
||||
if [[ ${PV} == 9999 ]] ; then
|
||||
@ -11,7 +11,7 @@ if [[ ${PV} == 9999 ]] ; then
|
||||
inherit git-r3
|
||||
else
|
||||
SRC_URI="https://www.kernel.org/pub/software/utils/${PN}/${P}.tar.xz"
|
||||
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||
fi
|
||||
|
||||
DESCRIPTION="Open Firmware device tree compiler"
|
||||
@ -27,7 +27,12 @@ BDEPEND="
|
||||
app-alternatives/yacc
|
||||
app-alternatives/lex
|
||||
virtual/pkgconfig
|
||||
python? ( dev-lang/swig )
|
||||
python? (
|
||||
dev-lang/swig
|
||||
$(python_gen_cond_dep '
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
')
|
||||
)
|
||||
"
|
||||
RDEPEND="
|
||||
python? ( ${PYTHON_DEPS} )
|
||||
@ -64,3 +69,9 @@ src_configure() {
|
||||
|
||||
meson_src_configure
|
||||
}
|
||||
|
||||
src_install() {
|
||||
meson_src_install
|
||||
|
||||
use python && python_optimize "${ED}"
|
||||
}
|
||||
|
@ -0,0 +1,41 @@
|
||||
https://github.com/dgibson/dtc/issues/163
|
||||
https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=ce1d8588880aecd7af264e422a16a8b33617cef7
|
||||
|
||||
From ce1d8588880aecd7af264e422a16a8b33617cef7 Mon Sep 17 00:00:00 2001
|
||||
From: David Gibson <david@gibson.dropbear.id.au>
|
||||
Date: Wed, 5 Feb 2025 13:39:43 +1100
|
||||
Subject: tests: When building .so from -O asm output mark as non-executable
|
||||
stack
|
||||
|
||||
For certain tests, we take the output from dtc -O asm and build it into
|
||||
a .so shared library which we then dlopen() for further tests. Because we
|
||||
don't mark it otherwise, it's treated as requiring an executable stack,
|
||||
which dlopen() refuses to open as of glibc-2.41.
|
||||
|
||||
Of course, the library is pure data, no code, so it certainly doesn't need
|
||||
an executable stack. Add the -znoexecstack linker option to avoid the
|
||||
error.
|
||||
|
||||
Fixes: https://github.com/dgibson/dtc/issues/163
|
||||
|
||||
Reported-by: Xi Ruoyao <xry111@xry111.site>
|
||||
Signed-off-by: David Gibson <david@gibson.dropbear.id.a>
|
||||
---
|
||||
tests/run_tests.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
|
||||
index 937b128..f0b51c0 100755
|
||||
--- a/tests/run_tests.sh
|
||||
+++ b/tests/run_tests.sh
|
||||
@@ -201,7 +201,7 @@ run_dtc_test () {
|
||||
}
|
||||
|
||||
asm_to_so () {
|
||||
- $CC -shared -o $1.test.so "$SRCDIR/data.S" $1.test.s
|
||||
+ $CC -shared -Wl,-znoexecstack -o $1.test.so "$SRCDIR/data.S" $1.test.s
|
||||
}
|
||||
|
||||
asm_to_so_test () {
|
||||
--
|
||||
cgit 1.2.3-korg
|
89
sdk_container/src/third_party/portage-stable/sys-apps/dtc/files/dtc-1.7.2-swig-4.3.patch
vendored
Normal file
89
sdk_container/src/third_party/portage-stable/sys-apps/dtc/files/dtc-1.7.2-swig-4.3.patch
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=9a969f3b70b07bbf1c9df44a38d7f8d1d3a6e2a5
|
||||
|
||||
From 9a969f3b70b07bbf1c9df44a38d7f8d1d3a6e2a5 Mon Sep 17 00:00:00 2001
|
||||
From: Brandon Maier <brandon.maier@gmail.com>
|
||||
Date: Sun, 24 Nov 2024 15:48:04 -0600
|
||||
Subject: pylibfdt/libfdt.i: fix backwards compatibility of return values
|
||||
|
||||
When our Python functions wrap `fdt_getprop()` they return a list
|
||||
containing `[*data, length]`.
|
||||
|
||||
In SWIG v4.2 and earlier SWIG would discard `*data` if it is NULL/None.
|
||||
Causing the return value to just be `length`.
|
||||
|
||||
But starting in SWIG v4.3 it no longer discards `*data`. So the return
|
||||
value is now `[None, length]`.
|
||||
|
||||
Handle this compatibility issue in libfdt.i by checking if the return
|
||||
value looks like the older 4.2 return value, and casting it to the newer
|
||||
style.
|
||||
|
||||
See https://github.com/swig/swig/pull/2907
|
||||
|
||||
Signed-off-by: Brandon Maier <brandon.maier@gmail.com>
|
||||
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
|
||||
---
|
||||
pylibfdt/libfdt.i | 25 ++++++++++++++-----------
|
||||
1 file changed, 14 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i
|
||||
index 9f5b6a9..bb9985c 100644
|
||||
--- a/pylibfdt/libfdt.i
|
||||
+++ b/pylibfdt/libfdt.i
|
||||
@@ -114,11 +114,14 @@ def check_err_null(val, quiet=()):
|
||||
FdtException if val indicates an error was reported and the error
|
||||
is not in @quiet.
|
||||
"""
|
||||
- # Normally a list is returned which contains the data and its length.
|
||||
- # If we get just an integer error code, it means the function failed.
|
||||
+ # Compatibility for SWIG v4.2 and earlier. SWIG 4.2 would drop the first
|
||||
+ # item from the list if it was None, returning only the second item.
|
||||
if not isinstance(val, list):
|
||||
- if -val not in quiet:
|
||||
- raise FdtException(val)
|
||||
+ val = [None, val]
|
||||
+
|
||||
+ if val[0] is None:
|
||||
+ if -val[1] not in quiet:
|
||||
+ raise FdtException(val[1])
|
||||
return val
|
||||
|
||||
class FdtRo(object):
|
||||
@@ -395,8 +398,8 @@ class FdtRo(object):
|
||||
"""
|
||||
pdata = check_err_null(
|
||||
fdt_get_property_by_offset(self._fdt, prop_offset), quiet)
|
||||
- if isinstance(pdata, (int)):
|
||||
- return pdata
|
||||
+ if pdata[0] is None:
|
||||
+ return pdata[1]
|
||||
return Property(pdata[0], pdata[1])
|
||||
|
||||
def getprop(self, nodeoffset, prop_name, quiet=()):
|
||||
@@ -417,8 +420,8 @@ class FdtRo(object):
|
||||
"""
|
||||
pdata = check_err_null(fdt_getprop(self._fdt, nodeoffset, prop_name),
|
||||
quiet)
|
||||
- if isinstance(pdata, (int)):
|
||||
- return pdata
|
||||
+ if pdata[0] is None:
|
||||
+ return pdata[1]
|
||||
return Property(prop_name, bytearray(pdata[0]))
|
||||
|
||||
def hasprop(self, nodeoffset, prop_name, quiet=()):
|
||||
@@ -444,10 +447,10 @@ class FdtRo(object):
|
||||
"""
|
||||
pdata = check_err_null(fdt_getprop(self._fdt, nodeoffset, prop_name),
|
||||
quiet + (NOTFOUND,))
|
||||
- if isinstance(pdata, (int)):
|
||||
- if pdata == -NOTFOUND:
|
||||
+ if pdata[0] is None:
|
||||
+ if pdata[1] == -NOTFOUND:
|
||||
return False
|
||||
- return pdata
|
||||
+ return pdata[1]
|
||||
return True
|
||||
|
||||
def get_phandle(self, nodeoffset):
|
||||
--
|
||||
cgit 1.2.3-korg
|
Loading…
x
Reference in New Issue
Block a user