[gentoo-commits] repo/gentoo:master commit in: sys-kernel/linux-headers/files/, sys-kernel/linux-headers/

2024-03-26 Thread Mike Gilbert
commit: 69a5fc41a89f8efd0bba4479af02fe460826868e
Author: Mike Gilbert  gentoo  org>
AuthorDate: Wed Mar 27 00:04:15 2024 +
Commit: Mike Gilbert  gentoo  org>
CommitDate: Wed Mar 27 00:07:09 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69a5fc41

sys-kernel/linux-headers: add fix for sparc

Closes: https://bugs.gentoo.org/918992
Signed-off-by: Mike Gilbert  gentoo.org>

 ...sparc-move-struct-termio-to-asm-termios.h.patch | 64 ++
 ...ders-6.6.ebuild => linux-headers-6.6-r1.ebuild} |  6 +-
 ...ders-6.7.ebuild => linux-headers-6.7-r1.ebuild} |  6 +-
 ...ders-6.8.ebuild => linux-headers-6.8-r1.ebuild} |  6 +-
 4 files changed, 76 insertions(+), 6 deletions(-)

diff --git 
a/sys-kernel/linux-headers/files/linux-headers-sparc-move-struct-termio-to-asm-termios.h.patch
 
b/sys-kernel/linux-headers/files/linux-headers-sparc-move-struct-termio-to-asm-termios.h.patch
new file mode 100644
index ..7e8a7353bc6a
--- /dev/null
+++ 
b/sys-kernel/linux-headers/files/linux-headers-sparc-move-struct-termio-to-asm-termios.h.patch
@@ -0,0 +1,64 @@
+https://bugs.gentoo.org/918992
+https://lkml.org/lkml/2024/3/6/1112
+
+From 91577201977e109b2bda95077cb5db30864ab96e Mon Sep 17 00:00:00 2001
+From: Mike Gilbert 
+Date: Tue, 5 Mar 2024 23:19:37 -0500
+Subject: [PATCH] sparc: move struct termio to asm/termios.h
+
+Every other arch declares struct termio in asm/termios.h, so make sparc
+match them.
+
+Resolves a build failure in the PPP software package, which includes
+both bits/ioctl-types.h via sys/ioctl.h (glibc) and asm/termbits.h.
+
+Closes: https://bugs.gentoo.org/918992
+Signed-off-by: Mike Gilbert 
+---
+ arch/sparc/include/uapi/asm/termbits.h | 10 --
+ arch/sparc/include/uapi/asm/termios.h  |  9 +
+ 2 files changed, 9 insertions(+), 10 deletions(-)
+
+diff --git a/arch/sparc/include/uapi/asm/termbits.h 
b/arch/sparc/include/uapi/asm/termbits.h
+index 4321322701fc..0da2b1adc0f5 100644
+--- a/arch/sparc/include/uapi/asm/termbits.h
 b/arch/sparc/include/uapi/asm/termbits.h
+@@ -10,16 +10,6 @@ typedef unsigned inttcflag_t;
+ typedef unsigned long tcflag_t;
+ #endif
+ 
+-#define NCC 8
+-struct termio {
+-  unsigned short c_iflag; /* input mode flags */
+-  unsigned short c_oflag; /* output mode flags */
+-  unsigned short c_cflag; /* control mode flags */
+-  unsigned short c_lflag; /* local mode flags */
+-  unsigned char c_line;   /* line discipline */
+-  unsigned char c_cc[NCC];/* control characters */
+-};
+-
+ #define NCCS 17
+ struct termios {
+   tcflag_t c_iflag;   /* input mode flags */
+diff --git a/arch/sparc/include/uapi/asm/termios.h 
b/arch/sparc/include/uapi/asm/termios.h
+index ee86f4093d83..cceb32260881 100644
+--- a/arch/sparc/include/uapi/asm/termios.h
 b/arch/sparc/include/uapi/asm/termios.h
+@@ -40,5 +40,14 @@ struct winsize {
+   unsigned short ws_ypixel;
+ };
+ 
++#define NCC 8
++struct termio {
++  unsigned short c_iflag; /* input mode flags */
++  unsigned short c_oflag; /* output mode flags */
++  unsigned short c_cflag; /* control mode flags */
++  unsigned short c_lflag; /* local mode flags */
++  unsigned char c_line;   /* line discipline */
++  unsigned char c_cc[NCC];/* control characters */
++};
+ 
+ #endif /* _UAPI_SPARC_TERMIOS_H */
+-- 
+2.44.0
+

diff --git a/sys-kernel/linux-headers/linux-headers-6.6.ebuild 
b/sys-kernel/linux-headers/linux-headers-6.6-r1.ebuild
similarity index 88%
rename from sys-kernel/linux-headers/linux-headers-6.6.ebuild
rename to sys-kernel/linux-headers/linux-headers-6.6-r1.ebuild
index 17d8fd815b5c..1b82b2d037f1 100644
--- a/sys-kernel/linux-headers/linux-headers-6.6.ebuild
+++ b/sys-kernel/linux-headers/linux-headers-6.6-r1.ebuild
@@ -24,14 +24,16 @@ BDEPEND="
dev-lang/perl
 "
 
-[[ -n ${PATCH_VER} ]] && PATCHES=( "${WORKDIR}"/${PATCH_PV} )
-
 src_unpack() {
# Avoid kernel-2_src_unpack
default
 }
 
 src_prepare() {
+   local PATCHES=()
+   [[ -n ${PATCH_VER} ]] && PATCHES+=( "${WORKDIR}"/${PATCH_PV} )
+   PATCHES+=( 
"${FILESDIR}"/${PN}-sparc-move-struct-termio-to-asm-termios.h.patch )
+
# TODO: May need forward porting to newer versions
use elibc_musl && PATCHES+=(
"${FILESDIR}"/${PN}-5.15-remove-inclusion-sysinfo.h.patch

diff --git a/sys-kernel/linux-headers/linux-headers-6.7.ebuild 
b/sys-kernel/linux-headers/linux-headers-6.7-r1.ebuild
similarity index 88%
rename from sys-kernel/linux-headers/linux-headers-6.7.ebuild
rename to sys-kernel/linux-headers/linux-headers-6.7-r1.ebuild
index e16c15ac5901..fe49fd6ed12e 100644
--- a/sys-kernel/linux-headers/linux-headers-6.7.ebuild
+++ b/sys-kernel/linux-headers/linux-headers-6.7-r1.ebuild
@@ -24,14 +24,16 @@ BDEPEND="
dev-lang/perl
 "
 
-[[ -n ${PATCH_VER} ]] && PATCHES=( 

[gentoo-commits] repo/gentoo:master commit in: sys-kernel/linux-headers/files/

2021-12-31 Thread Sam James
commit: de6cb5ec34088e967ec58b0ea1f73972e6cad3b9
Author: Sam James  gentoo  org>
AuthorDate: Sat Jan  1 00:10:19 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Jan  1 00:10:32 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de6cb5ec

sys-kernel/linux-headers: fix musl patch for 5.15

Closes: https://bugs.gentoo.org/830338
Signed-off-by: Sam James  gentoo.org>

 .../files/linux-headers-5.15-remove-inclusion-sysinfo.h.patch | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/sys-kernel/linux-headers/files/linux-headers-5.15-remove-inclusion-sysinfo.h.patch
 
b/sys-kernel/linux-headers/files/linux-headers-5.15-remove-inclusion-sysinfo.h.patch
index 11760b93227c..aa52ff9bd141 100644
--- 
a/sys-kernel/linux-headers/files/linux-headers-5.15-remove-inclusion-sysinfo.h.patch
+++ 
b/sys-kernel/linux-headers/files/linux-headers-5.15-remove-inclusion-sysinfo.h.patch
@@ -13,12 +13,13 @@ as none of its functionality is needed.
 
 --- a/include/uapi/linux/kernel.h
 +++ b/include/uapi/linux/kernel.h
-@@ -4,7 +4,7 @@
+@@ -2,7 +2,9 @@
+ #ifndef _UAPI_LINUX_KERNEL_H
+ #define _UAPI_LINUX_KERNEL_H
  
- #ifdef __GLIBC__
++#ifdef __GLIBC__
  #include 
--#include 
- #endif
-+#include 
++#endif
+ #include 
  
  #endif /* _UAPI_LINUX_KERNEL_H */



[gentoo-commits] repo/gentoo:master commit in: sys-kernel/linux-headers/files/, sys-kernel/linux-headers/

2021-12-30 Thread Sam James
commit: 87dd049078d78e654436f3cb084091ef69376ee8
Author: Sam James  gentoo  org>
AuthorDate: Fri Dec 31 02:46:44 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Fri Dec 31 02:50:00 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87dd0490

sys-kernel/linux-headers: fix 5.15 patch

We don't need to drop the const bit, avoids us patching consumers.

Thanks-to: Jory A. Pratt  gentoo.org>
Signed-off-by: Sam James  gentoo.org>

 ...linux-headers-5.15-remove-inclusion-sysinfo.h.patch | 18 +-
 ...ers-5.15-r2.ebuild => linux-headers-5.15-r3.ebuild} |  0
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/sys-kernel/linux-headers/files/linux-headers-5.15-remove-inclusion-sysinfo.h.patch
 
b/sys-kernel/linux-headers/files/linux-headers-5.15-remove-inclusion-sysinfo.h.patch
index 064066f19ef6..11760b93227c 100644
--- 
a/sys-kernel/linux-headers/files/linux-headers-5.15-remove-inclusion-sysinfo.h.patch
+++ 
b/sys-kernel/linux-headers/files/linux-headers-5.15-remove-inclusion-sysinfo.h.patch
@@ -1,6 +1,8 @@
-Earlier version: 
https://git.alpinelinux.org/aports/tree/main/linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
+https://git.alpinelinux.org/aports/tree/main/linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
 https://bugs.gentoo.org/828726
 
+[Adapted to drop the const.h change as things may rely on it like btrfs.]
+
 From: rofl0r 
 Date: Mon, 20 Jan 2014 21:31:34 +0100
 Subject: [PATCH 3/3] remove inclusion of sysinfo.h in kernel.h
@@ -8,17 +10,15 @@ Subject: [PATCH 3/3] remove inclusion of sysinfo.h in 
kernel.h
 the declaration of struct sysinfo clashes with userspace.
 it's not quite clear why that header was included from kernel.h,
 as none of its functionality is needed.
+
 --- a/include/uapi/linux/kernel.h
 +++ b/include/uapi/linux/kernel.h
-@@ -2,7 +2,9 @@
- #ifndef _UAPI_LINUX_KERNEL_H
- #define _UAPI_LINUX_KERNEL_H
+@@ -4,7 +4,7 @@
  
-+#ifdef __GLIBC__
+ #ifdef __GLIBC__
  #include 
- #include 
-+#endif
+-#include 
+ #endif
++#include 
  
  #endif /* _UAPI_LINUX_KERNEL_H */
-
-

diff --git a/sys-kernel/linux-headers/linux-headers-5.15-r2.ebuild 
b/sys-kernel/linux-headers/linux-headers-5.15-r3.ebuild
similarity index 100%
rename from sys-kernel/linux-headers/linux-headers-5.15-r2.ebuild
rename to sys-kernel/linux-headers/linux-headers-5.15-r3.ebuild



[gentoo-commits] repo/gentoo:master commit in: sys-kernel/linux-headers/files/, sys-kernel/linux-headers/

2021-12-30 Thread Sam James
commit: 1ef3659212ff98d2e6bb5df51e405c0953a45fec
Author: Sam James  gentoo  org>
AuthorDate: Thu Dec 30 09:37:33 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Dec 30 09:37:37 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ef36592

sys-kernel/linux-headers: fix 5.10 for musl (sysinfo.h)

Notably fixes btrfs-progs build.

Closes: https://bugs.gentoo.org/828726
Signed-off-by: Sam James  gentoo.org>

 ...x-headers-5.10-remove-inclusion-sysinfo.h.patch | 24 +++
 .../linux-headers/linux-headers-5.10-r2.ebuild | 49 ++
 2 files changed, 73 insertions(+)

diff --git 
a/sys-kernel/linux-headers/files/linux-headers-5.10-remove-inclusion-sysinfo.h.patch
 
b/sys-kernel/linux-headers/files/linux-headers-5.10-remove-inclusion-sysinfo.h.patch
new file mode 100644
index ..7f23d77a71a5
--- /dev/null
+++ 
b/sys-kernel/linux-headers/files/linux-headers-5.10-remove-inclusion-sysinfo.h.patch
@@ -0,0 +1,24 @@
+https://git.alpinelinux.org/aports/tree/main/linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
+https://bugs.gentoo.org/828726
+
+From: rofl0r 
+Date: Mon, 20 Jan 2014 21:31:34 +0100
+Subject: [PATCH 3/3] remove inclusion of sysinfo.h in kernel.h
+
+the declaration of struct sysinfo clashes with userspace.
+it's not quite clear why that header was included from kernel.h,
+as none of its functionality is needed.
+--- a/include/uapi/linux/kernel.h
 b/include/uapi/linux/kernel.h
+@@ -2,7 +2,9 @@
+ #ifndef _UAPI_LINUX_KERNEL_H
+ #define _UAPI_LINUX_KERNEL_H
+ 
++#ifdef __GLIBC__
+ #include 
++#endif
+ #include 
+ 
+ #endif /* _UAPI_LINUX_KERNEL_H */
+
+

diff --git a/sys-kernel/linux-headers/linux-headers-5.10-r2.ebuild 
b/sys-kernel/linux-headers/linux-headers-5.10-r2.ebuild
new file mode 100644
index ..26138c3d9ff4
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-5.10-r2.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 cris frv hexagon hppa ia64 
m68k metag microblaze mips mn10300 nios2 openrisc ppc ppc64 riscv s390 score sh 
sparc x86 xtensa"
+inherit kernel-2 toolchain-funcs
+detect_version
+
+PATCH_PV=${PV} # to ease testing new versions against not existing patches
+PATCH_VER="1"
+SRC_URI="${KERNEL_URI}
+   
${PATCH_VER:+mirror://gentoo/gentoo-headers-${PATCH_PV}-${PATCH_VER}.tar.xz}
+   
${PATCH_VER:+https://dev.gentoo.org/~sam/distfiles/gentoo-headers-${PATCH_PV}-${PATCH_VER}.tar.xz}
+"
+S="${WORKDIR}"/linux-${PV}
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv 
~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+BDEPEND="app-arch/xz-utils
+   dev-lang/perl"
+
+src_unpack() {
+   unpack ${A}
+}
+
+src_prepare() {
+   [[ -n ${PATCH_VER} ]] && eapply "${WORKDIR}"/${PATCH_PV}/*.patch
+
+   if use elibc_musl ; then
+   # TODO: May need forward porting to newer versions
+   eapply 
"${FILESDIR}"/${PN}-5.10-Use-stddefs.h-instead-of-compiler.h.patch
+   eapply "${FILESDIR}"/${PN}-5.10-remove-inclusion-sysinfo.h.patch
+   fi
+
+   default
+}
+
+src_test() {
+   emake headers_check ${xmakeopts}
+}
+
+src_install() {
+   kernel-2_src_install
+
+   find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+   find "${ED}" -depth -type d -delete 2>/dev/null
+}



[gentoo-commits] repo/gentoo:master commit in: sys-kernel/linux-headers/files/

2021-12-22 Thread Sam James
commit: fc38e3f625d2aee08a90e2eb19a80ccadf945094
Author: Sam James  gentoo  org>
AuthorDate: Thu Dec 23 03:14:38 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Dec 23 03:14:38 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc38e3f6

sys-kernel/linux-headers: add more background to musl patch

Signed-off-by: Sam James  gentoo.org>

 ...-5.10-Use-stddefs.h-instead-of-compiler.h.patch | 47 --
 1 file changed, 35 insertions(+), 12 deletions(-)

diff --git 
a/sys-kernel/linux-headers/files/linux-headers-5.10-Use-stddefs.h-instead-of-compiler.h.patch
 
b/sys-kernel/linux-headers/files/linux-headers-5.10-Use-stddefs.h-instead-of-compiler.h.patch
index ac8bbe8b55fc..07c780fef26d 100644
--- 
a/sys-kernel/linux-headers/files/linux-headers-5.10-Use-stddefs.h-instead-of-compiler.h.patch
+++ 
b/sys-kernel/linux-headers/files/linux-headers-5.10-Use-stddefs.h-instead-of-compiler.h.patch
@@ -1,16 +1,42 @@
 Needed for musl.
 
-From 9eb3c31415686ae1296d7d450f886eeba5861ec1 Mon Sep 17 00:00:00 2001
-From: Jory Pratt 
-Date: Thu, 3 Jun 2021 18:41:28 -0500
-Subject: [PATCH] Use stddefs.h instead of compiler.h
+https://git.alpinelinux.org/aports/tree/main/linux-headers/include-uapi-linux-swab-Fix-potentially-missing-__always_inline.patch
 

- include/uapi/linux/swab.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+From: Matt Redfearn 
+Date: Wed, 3 Jan 2018 09:57:30 +
+Subject: [PATCH] include/uapi/linux/swab: Fix potentially missing
+ __always_inline
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Commit bc27fb68aaad ("include/uapi/linux/byteorder, swab: force inlining
+of some byteswap operations") added __always_inline to swab functions
+and commit 283d75737837 ("uapi/linux/stddef.h: Provide __always_inline to
+userspace headers") added a definition of __always_inline for use in
+exported headers when the kernel's compiler.h is not available.
+
+However, since swab.h does not include stddef.h, if the header soup does
+not indirectly include it, the definition of __always_inline is missing,
+resulting in a compilation failure, which was observed compiling the
+perf tool using exported headers containing this commit:
+
+In file included from /usr/include/linux/byteorder/little_endian.h:12:0,
+ from /usr/include/asm/byteorder.h:14,
+ from tools/include/uapi/linux/perf_event.h:20,
+ from perf.h:8,
+ from builtin-bench.c:18:
+/usr/include/linux/swab.h:160:8: error: unknown type name ‘__always_inline’
+ static __always_inline __u16 __swab16p(const __u16 *p)
+
+Fix this by replacing the inclusion of linux/compiler.h with
+linux/stddef.h to ensure that we pick up that definition if required,
+without relying on it's indirect inclusion. compiler.h is then included
+indirectly, via stddef.h.
+
+Fixes: 283d75737837 ("uapi/linux/stddef.h: Provide __always_inline to 
userspace headers")
+Signed-off-by: Matt Redfearn 
 
-diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h
-index 7272f85..3736f2f 100644
 --- a/include/uapi/linux/swab.h
 +++ b/include/uapi/linux/swab.h
 @@ -3,7 +3,7 @@
@@ -22,6 +48,3 @@ index 7272f85..3736f2f 100644
  #include 
  #include 
  
--- 
-2.31.1
-