* [gentoo-dev] [PATCH 2/6] dist-kernel-utils.eclass: dist-kernel_get_image_path: handle sparc
2023-07-21 12:46 [gentoo-dev] [PATCH 1/6] toolchain-funcs.eclass: tc-ninja_magic_to_arch: rename helper function Sam James
@ 2023-07-21 12:46 ` Sam James
2023-07-21 12:46 ` [gentoo-dev] [PATCH 3/6] kernel-build.eclass: add special-case for sparc arch/ directory Sam James
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2023-07-21 12:46 UTC (permalink / raw
To: gentoo-dev; +Cc: toolchain, dist-kernel, sparc, Sam James
Same as hppa/ppc*.
Signed-off-by: Sam James <sam@gentoo.org>
---
eclass/dist-kernel-utils.eclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eclass/dist-kernel-utils.eclass b/eclass/dist-kernel-utils.eclass
index cb0021f8b3a7e..6668960286699 100644
--- a/eclass/dist-kernel-utils.eclass
+++ b/eclass/dist-kernel-utils.eclass
@@ -77,7 +77,7 @@ dist-kernel_get_image_path() {
arm)
echo arch/arm/boot/zImage
;;
- hppa|ppc|ppc64)
+ hppa|ppc|ppc64|sparc)
# https://www.kernel.org/doc/html/latest/powerpc/bootwrapper.html
# ./ is required because of ${image_path%/*}
# substitutions in the code
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-dev] [PATCH 3/6] kernel-build.eclass: add special-case for sparc arch/ directory
2023-07-21 12:46 [gentoo-dev] [PATCH 1/6] toolchain-funcs.eclass: tc-ninja_magic_to_arch: rename helper function Sam James
2023-07-21 12:46 ` [gentoo-dev] [PATCH 2/6] dist-kernel-utils.eclass: dist-kernel_get_image_path: handle sparc Sam James
@ 2023-07-21 12:46 ` Sam James
2023-07-21 12:46 ` [gentoo-dev] [PATCH 4/6] kernel-install.eclass: kernel-install_get_qemu_arch: port to sparc Sam James
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2023-07-21 12:46 UTC (permalink / raw
To: gentoo-dev; +Cc: toolchain, dist-kernel, sparc, Sam James
Unfortunately, we still have a mess wrt dual-bitness arches.
For sparc, there's arch/sparc, with ARCH=sparc being "whatever the toolchain is",
ARCH=sparc32 being "give me a 32-bit kernel", and ARCH=sparc64 being "give me
a 64-bit kernel".
You do, seemingly, need to actually pass ARCH=sparc64 to guarantee correct results,
as various kernel Makefiles check for the ARCH value, even though ARCH=sparc will
pop out a 64-bit kernel.
(I originally updated toolchain-funcs.eclass's tc-ninja_magic_to_arch, but we
later found that doesn't look particularly sturdy.
Per at the very least 5ba800962a80d4158b73fb91a7779df7b770c750 ("kbuild: update ARCH alias info for sparc")
upstream, although it seems to go back a fair bit earlier, ARCH=sparc when building
the kernel means "sparc64" if on a sparc64 host.)
Signed-off-by: Sam James <sam@gentoo.org>
---
eclass/kernel-build.eclass | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index ff615a02d0ebf..276a08a104e0e 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -257,6 +257,14 @@ kernel-build_src_install() {
local kern_arch=$(tc-arch-kernel)
local dir_ver=${PV}${KV_LOCALVERSION}
local kernel_dir=/usr/src/linux-${dir_ver}
+
+ if use sparc ; then
+ # We don't want tc-arch-kernel's sparc64, even though we do
+ # need to pass ARCH=sparc64 to the build system. It's a quasi-alias
+ # in Kbuild.
+ kern_arch=sparc
+ fi
+
dodir "${kernel_dir}/arch/${kern_arch}"
mv include scripts "${ED}${kernel_dir}/" || die
mv "arch/${kern_arch}/include" \
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-dev] [PATCH 4/6] kernel-install.eclass: kernel-install_get_qemu_arch: port to sparc
2023-07-21 12:46 [gentoo-dev] [PATCH 1/6] toolchain-funcs.eclass: tc-ninja_magic_to_arch: rename helper function Sam James
2023-07-21 12:46 ` [gentoo-dev] [PATCH 2/6] dist-kernel-utils.eclass: dist-kernel_get_image_path: handle sparc Sam James
2023-07-21 12:46 ` [gentoo-dev] [PATCH 3/6] kernel-build.eclass: add special-case for sparc arch/ directory Sam James
@ 2023-07-21 12:46 ` Sam James
2023-07-21 12:58 ` Ulrich Mueller
2023-07-21 14:49 ` Michał Górny
2023-07-21 12:46 ` [gentoo-dev] [PATCH 5/6] sys-kernel/gentoo-kernel: " Sam James
2023-07-21 12:46 ` [gentoo-dev] [PATCH 6/6] virtual/dist-kernel: keyword ~sparc Sam James
4 siblings, 2 replies; 10+ messages in thread
From: Sam James @ 2023-07-21 12:46 UTC (permalink / raw
To: gentoo-dev; +Cc: toolchain, dist-kernel, sparc, Sam James
Signed-off-by: Sam James <sam@gentoo.org>
---
eclass/kernel-install.eclass | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 49aff35dea0d2..6018abd821513 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -1,4 +1,4 @@
-# Copyright 2020-2022 Gentoo Authors
+# Copyright 2020-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: kernel-install.eclass
@@ -162,6 +162,12 @@ kernel-install_get_qemu_arch() {
ppc64)
echo ppc64
;;
+ sparc)
+ echo sparc
+ ;;
+ sparc64)
+ echo sparc64
+ ;;
riscv)
echo riscv
;;
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [gentoo-dev] [PATCH 4/6] kernel-install.eclass: kernel-install_get_qemu_arch: port to sparc
2023-07-21 12:46 ` [gentoo-dev] [PATCH 4/6] kernel-install.eclass: kernel-install_get_qemu_arch: port to sparc Sam James
@ 2023-07-21 12:58 ` Ulrich Mueller
2023-07-21 13:16 ` Sam James
2023-07-21 14:49 ` Michał Górny
1 sibling, 1 reply; 10+ messages in thread
From: Ulrich Mueller @ 2023-07-21 12:58 UTC (permalink / raw
To: Sam James; +Cc: gentoo-dev, toolchain, dist-kernel, sparc
[-- Attachment #1: Type: text/plain, Size: 347 bytes --]
>>>>> On Fri, 21 Jul 2023, Sam James wrote:
> @@ -162,6 +162,12 @@ kernel-install_get_qemu_arch() {
> ppc64)
> echo ppc64
> ;;
> + sparc)
> + echo sparc
> + ;;
> + sparc64)
> + echo sparc64
> + ;;
> riscv)
> echo riscv
> ;;
Looks like the case patterns are in alphabetical order everywhere else,
so why not here?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-dev] [PATCH 4/6] kernel-install.eclass: kernel-install_get_qemu_arch: port to sparc
2023-07-21 12:58 ` Ulrich Mueller
@ 2023-07-21 13:16 ` Sam James
0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2023-07-21 13:16 UTC (permalink / raw
To: gentoo-dev; +Cc: Sam James, toolchain, dist-kernel, sparc
[-- Attachment #1: Type: text/plain, Size: 508 bytes --]
Ulrich Mueller <ulm@gentoo.org> writes:
> [[PGP Signed Part:Undecided]]
>>>>>> On Fri, 21 Jul 2023, Sam James wrote:
>
>> @@ -162,6 +162,12 @@ kernel-install_get_qemu_arch() {
>> ppc64)
>> echo ppc64
>> ;;
>> + sparc)
>> + echo sparc
>> + ;;
>> + sparc64)
>> + echo sparc64
>> + ;;
>> riscv)
>> echo riscv
>> ;;
>
> Looks like the case patterns are in alphabetical order everywhere else,
> so why not here?
It was late and I forgot the alphabet ;)
I'll fix that locally.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 377 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-dev] [PATCH 4/6] kernel-install.eclass: kernel-install_get_qemu_arch: port to sparc
2023-07-21 12:46 ` [gentoo-dev] [PATCH 4/6] kernel-install.eclass: kernel-install_get_qemu_arch: port to sparc Sam James
2023-07-21 12:58 ` Ulrich Mueller
@ 2023-07-21 14:49 ` Michał Górny
2023-07-21 15:05 ` Ulrich Mueller
1 sibling, 1 reply; 10+ messages in thread
From: Michał Górny @ 2023-07-21 14:49 UTC (permalink / raw
To: gentoo-dev; +Cc: toolchain, dist-kernel, sparc, Sam James
On Fri, 2023-07-21 at 13:46 +0100, Sam James wrote:
> Signed-off-by: Sam James <sam@gentoo.org>
> ---
> eclass/kernel-install.eclass | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
> index 49aff35dea0d2..6018abd821513 100644
> --- a/eclass/kernel-install.eclass
> +++ b/eclass/kernel-install.eclass
> @@ -1,4 +1,4 @@
> -# Copyright 2020-2022 Gentoo Authors
> +# Copyright 2020-2023 Gentoo Authors
> # Distributed under the terms of the GNU General Public License v2
>
> # @ECLASS: kernel-install.eclass
> @@ -162,6 +162,12 @@ kernel-install_get_qemu_arch() {
> ppc64)
> echo ppc64
> ;;
> + sparc)
> + echo sparc
> + ;;
> + sparc64)
> + echo sparc64
> + ;;
> riscv)
> echo riscv
> ;;
I suppose I originally didn't anticipate this many "matching" arches but
perhaps it's time to add something like:
arm|ppc|ppc64|riscv|sparc|sparc64)
echo ${ARCH}
;;
--
Best regards,
Michał Górny
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [gentoo-dev] [PATCH 4/6] kernel-install.eclass: kernel-install_get_qemu_arch: port to sparc
2023-07-21 14:49 ` Michał Górny
@ 2023-07-21 15:05 ` Ulrich Mueller
0 siblings, 0 replies; 10+ messages in thread
From: Ulrich Mueller @ 2023-07-21 15:05 UTC (permalink / raw
To: Michał Górny
Cc: gentoo-dev, toolchain, dist-kernel, sparc, Sam James
[-- Attachment #1: Type: text/plain, Size: 427 bytes --]
>>>>> On Fri, 21 Jul 2023, Michał Górny wrote:
> I suppose I originally didn't anticipate this many "matching" arches but
> perhaps it's time to add something like:
> arm|ppc|ppc64|riscv|sparc|sparc64)
> echo ${ARCH}
> ;;
Sounds good.
As a side note, eselect has a table with the (nearly) inverse mapping:
https://gitweb.gentoo.org/proj/eselect.git/tree/libs/package-manager.bash.in?h=eselect-1.4.25#n70
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* [gentoo-dev] [PATCH 5/6] sys-kernel/gentoo-kernel: port to sparc
2023-07-21 12:46 [gentoo-dev] [PATCH 1/6] toolchain-funcs.eclass: tc-ninja_magic_to_arch: rename helper function Sam James
` (2 preceding siblings ...)
2023-07-21 12:46 ` [gentoo-dev] [PATCH 4/6] kernel-install.eclass: kernel-install_get_qemu_arch: port to sparc Sam James
@ 2023-07-21 12:46 ` Sam James
2023-07-21 12:46 ` [gentoo-dev] [PATCH 6/6] virtual/dist-kernel: keyword ~sparc Sam James
4 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2023-07-21 12:46 UTC (permalink / raw
To: gentoo-dev; +Cc: toolchain, dist-kernel, sparc, Sam James
Signed-off-by: Sam James <sam@gentoo.org>
---
profiles/arch/sparc/package.use.mask | 5 +++++
.../gentoo-kernel/gentoo-kernel-5.15.120.ebuild | 11 +++++++++--
sys-kernel/gentoo-kernel/gentoo-kernel-6.1.39.ebuild | 12 +++++++++---
sys-kernel/gentoo-kernel/gentoo-kernel-6.4.4.ebuild | 12 +++++++++---
4 files changed, 32 insertions(+), 8 deletions(-)
diff --git a/profiles/arch/sparc/package.use.mask b/profiles/arch/sparc/package.use.mask
index 666be07eea63a..0d1e5ce3fb0fd 100644
--- a/profiles/arch/sparc/package.use.mask
+++ b/profiles/arch/sparc/package.use.mask
@@ -1,6 +1,11 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+# Sam James <sam@gentoo.org> (2023-07-21)
+# Requires dev-util/pahole.
+sys-kernel/gentoo-kernel debug
+sys-kernel/vanilla-kernel debug
+
# Sam James <sam@gentoo.org> (2023-06-18)
# Qt 5 not keyworded here
app-text/ansifilter gui
diff --git a/sys-kernel/gentoo-kernel/gentoo-kernel-5.15.120.ebuild b/sys-kernel/gentoo-kernel/gentoo-kernel-5.15.120.ebuild
index 5e46267db599c..b6589cdcbf677 100644
--- a/sys-kernel/gentoo-kernel/gentoo-kernel-5.15.120.ebuild
+++ b/sys-kernel/gentoo-kernel/gentoo-kernel-5.15.120.ebuild
@@ -42,9 +42,13 @@ SRC_URI+="
S=${WORKDIR}/${MY_P}
LICENSE="GPL-2"
-KEYWORDS="amd64 ~arm arm64 ~hppa ~ppc ppc64 x86"
+KEYWORDS="amd64 ~arm arm64 ~hppa ~ppc ppc64 ~sparc x86"
IUSE="debug hardened"
-REQUIRED_USE="arm? ( savedconfig )"
+REQUIRED_USE="
+ arm? ( savedconfig )
+ hppa? ( savedconfig )
+ sparc? ( savedconfig )
+"
RDEPEND="
!sys-kernel/gentoo-kernel-bin:${SLOT}
@@ -95,6 +99,9 @@ src_prepare() {
cp "${DISTDIR}/kernel-ppc64le-fedora.config.${CONFIG_VER}" .config || die
biendian=true
;;
+ sparc)
+ return
+ ;;
x86)
cp "${DISTDIR}/kernel-i686-fedora.config.${CONFIG_VER}" .config || die
;;
diff --git a/sys-kernel/gentoo-kernel/gentoo-kernel-6.1.39.ebuild b/sys-kernel/gentoo-kernel/gentoo-kernel-6.1.39.ebuild
index c338d2cfc68f0..7e128b87c8f2c 100644
--- a/sys-kernel/gentoo-kernel/gentoo-kernel-6.1.39.ebuild
+++ b/sys-kernel/gentoo-kernel/gentoo-kernel-6.1.39.ebuild
@@ -43,11 +43,14 @@ SRC_URI+="
S=${WORKDIR}/${MY_P}
LICENSE="GPL-2"
-KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~x86"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
IUSE="debug hardened"
-REQUIRED_USE="arm? ( savedconfig )
+REQUIRED_USE="
+ arm? ( savedconfig )
hppa? ( savedconfig )
- riscv? ( savedconfig )"
+ riscv? ( savedconfig )
+ sparc? ( savedconfig )
+"
RDEPEND="
!sys-kernel/gentoo-kernel-bin:${SLOT}
@@ -101,6 +104,9 @@ src_prepare() {
riscv)
return
;;
+ sparc)
+ return
+ ;;
x86)
cp "${DISTDIR}/kernel-i686-fedora.config.${CONFIG_VER}" .config || die
;;
diff --git a/sys-kernel/gentoo-kernel/gentoo-kernel-6.4.4.ebuild b/sys-kernel/gentoo-kernel/gentoo-kernel-6.4.4.ebuild
index 5cb60e23b8533..38b5f48b2b817 100644
--- a/sys-kernel/gentoo-kernel/gentoo-kernel-6.4.4.ebuild
+++ b/sys-kernel/gentoo-kernel/gentoo-kernel-6.4.4.ebuild
@@ -44,11 +44,14 @@ SRC_URI+="
S=${WORKDIR}/${MY_P}
LICENSE="GPL-2"
-KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~x86"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
IUSE="debug hardened"
-REQUIRED_USE="arm? ( savedconfig )
+REQUIRED_USE="
+ arm? ( savedconfig )
hppa? ( savedconfig )
- riscv? ( savedconfig )"
+ riscv? ( savedconfig )
+ sparc? ( savedconfig )
+"
RDEPEND="
!sys-kernel/gentoo-kernel-bin:${SLOT}
@@ -102,6 +105,9 @@ src_prepare() {
riscv)
return
;;
+ sparc)
+ return
+ ;;
x86)
cp "${DISTDIR}/kernel-i686-fedora.config.${CONFIG_VER}" .config || die
;;
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-dev] [PATCH 6/6] virtual/dist-kernel: keyword ~sparc
2023-07-21 12:46 [gentoo-dev] [PATCH 1/6] toolchain-funcs.eclass: tc-ninja_magic_to_arch: rename helper function Sam James
` (3 preceding siblings ...)
2023-07-21 12:46 ` [gentoo-dev] [PATCH 5/6] sys-kernel/gentoo-kernel: " Sam James
@ 2023-07-21 12:46 ` Sam James
4 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2023-07-21 12:46 UTC (permalink / raw
To: gentoo-dev; +Cc: toolchain, dist-kernel, sparc, Sam James
Signed-off-by: Sam James <sam@gentoo.org>
---
virtual/dist-kernel/dist-kernel-5.15.120.ebuild | 2 +-
virtual/dist-kernel/dist-kernel-6.1.39.ebuild | 2 +-
virtual/dist-kernel/dist-kernel-6.4.4.ebuild | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/virtual/dist-kernel/dist-kernel-5.15.120.ebuild b/virtual/dist-kernel/dist-kernel-5.15.120.ebuild
index 5fe06a3498482..eab6f8597102c 100644
--- a/virtual/dist-kernel/dist-kernel-5.15.120.ebuild
+++ b/virtual/dist-kernel/dist-kernel-5.15.120.ebuild
@@ -9,7 +9,7 @@ SRC_URI=""
LICENSE=""
SLOT="0/${PV}"
-KEYWORDS="amd64 ~arm arm64 ~hppa ~ppc ppc64 x86"
+KEYWORDS="amd64 ~arm arm64 ~hppa ~ppc ppc64 ~sparc x86"
RDEPEND="
|| (
diff --git a/virtual/dist-kernel/dist-kernel-6.1.39.ebuild b/virtual/dist-kernel/dist-kernel-6.1.39.ebuild
index d3f0fa8764cf5..8012e544096f9 100644
--- a/virtual/dist-kernel/dist-kernel-6.1.39.ebuild
+++ b/virtual/dist-kernel/dist-kernel-6.1.39.ebuild
@@ -9,7 +9,7 @@ SRC_URI=""
LICENSE=""
SLOT="0/${PV}"
-KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~x86"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
RDEPEND="
|| (
diff --git a/virtual/dist-kernel/dist-kernel-6.4.4.ebuild b/virtual/dist-kernel/dist-kernel-6.4.4.ebuild
index d3f0fa8764cf5..8012e544096f9 100644
--- a/virtual/dist-kernel/dist-kernel-6.4.4.ebuild
+++ b/virtual/dist-kernel/dist-kernel-6.4.4.ebuild
@@ -9,7 +9,7 @@ SRC_URI=""
LICENSE=""
SLOT="0/${PV}"
-KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~x86"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
RDEPEND="
|| (
--
2.41.0
^ permalink raw reply related [flat|nested] 10+ messages in thread