[gentoo-commits] proj/toolchain/linux-headers-patches:master commit in: 5.3/

2019-11-07 Thread Sergei Trofimovich
commit: ba734355267d4accb9a4bd8143dbc880ac5044bc
Author: Sergei Trofimovich  gentoo  org>
AuthorDate: Thu Nov  7 22:55:19 2019 +
Commit: Sergei Trofimovich  gentoo  org>
CommitDate: Thu Nov  7 22:55:19 2019 +
URL:
https://gitweb.gentoo.org/proj/toolchain/linux-headers-patches.git/commit/?id=ba734355

5.3: don't include sysinfo.h on non-glibc libcs

https://lore.kernel.org/patchwork/patch/449607/
https://gitweb.gentoo.org/proj/musl.git/tree/sys-kernel/linux-headers/files/libc-5.1-remove-sysinfo_h-from-kernel_h.patch

Reported-by: Anarchy
Signed-off-by: Sergei Trofimovich  gentoo.org>

 ...ecific-inclusion-of-sysinfo.h-in-kernel.h.patch | 46 ++
 1 file changed, 46 insertions(+)

diff --git 
a/5.3/00_all_0009_glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch 
b/5.3/00_all_0009_glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch
new file mode 100644
index 000..df075dc
--- /dev/null
+++ b/5.3/00_all_0009_glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch
@@ -0,0 +1,46 @@
+https://lore.kernel.org/patchwork/patch/449607/
+https://gitweb.gentoo.org/proj/musl.git/tree/sys-kernel/linux-headers/files/libc-5.1-remove-sysinfo_h-from-kernel_h.patch
+
+Date: Fri, 14 Mar 2014 17:14:10 +0100
+From: David Heidelberger 
+To: linux-ker...@vger.kernel.org
+Cc: maillist-li...@barfooze.de, torva...@linux-foundation.org
+Subject: [PATCH 1/4] glibc specific inclusion of sysinfo.h in kernel.h
+Message-ID: <130a9e0c237bae10e631a5ae52c5e...@ixit.cz>
+User-Agent: Roundcube Webmail/0.9.5
+Sender: linux-kernel-ow...@vger.kernel.org
+List-ID: 
+X-Mailing-List: linux-ker...@vger.kernel.org
+
+including sysinfo.h from kernel.h makes no sense whatsoever,
+but removing it breaks glibc's userspace header,
+which includes kernel.h instead of sysinfo.h from their sys/sysinfo.h.
+this seems to be a historical mistake.
+on musl, including any header that uses kernel.h directly or indirectly
+plus sys/sysinfo.h will produce a compile error due to redefinition of
+struct sysinfo.h.
+so for now, only include it on glibc in order not to break their 
+headers.
+
+Signed-off-by: John Spencer 
+Signed-off-by: David Heidelberger 
+---
+  include/uapi/linux/kernel.h | 2 ++
+  1 file changed, 2 insertion(+)
+
+   */
+
+diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h
+index 321e399..8c45eeb 100644
+--- a/include/uapi/linux/kernel.h
 b/include/uapi/linux/kernel.h
+@@ -1,7 +1,9 @@
+ #ifndef _UAPI_LINUX_KERNEL_H
+ #define _UAPI_LINUX_KERNEL_H
+
++#ifdef __GLIBC__
+ #include 
++#endif
+
+ /*
+  * 'kernel.h' contains some often-used function prototypes etc



[gentoo-commits] proj/toolchain/linux-headers-patches:master commit in: 5.3/

2019-09-17 Thread Sergei Trofimovich
commit: f4570a565611f04926773ebd38077908015ea913
Author: Sergei Trofimovich  gentoo  org>
AuthorDate: Tue Sep 17 22:38:11 2019 +
Commit: Sergei Trofimovich  gentoo  org>
CommitDate: Tue Sep 17 22:38:11 2019 +
URL:
https://gitweb.gentoo.org/proj/toolchain/linux-headers-patches.git/commit/?id=f4570a56

5.3: copy 5.2 patches as is

Signed-off-by: Sergei Trofimovich  gentoo.org>

 ...0001-linux-stat.h-remove-__GLIBC__-checks.patch | 28 
 5.3/00_all_0002-netfilter-pull-in-limits.h.patch   | 28 
 5.3/00_all_0003-convert-PAGE_SIZE-usage.patch  | 54 +++
 ...ric-fcntl.h-namespace-kernel-file-structs.patch | 54 +++
 ..._0005-unifdef-drop-unused-errno.h-include.patch | 32 +
 ...build-relocs-tool-when-installing-headers.patch | 33 ++
 ...k-drop-int-cast-on-length-arg-in-NLMSG_OK.patch | 43 
 ...008-uapi-fix-System-V-buf-header-includes.patch | 76 ++
 8 files changed, 348 insertions(+)

diff --git a/5.3/00_all_0001-linux-stat.h-remove-__GLIBC__-checks.patch 
b/5.3/00_all_0001-linux-stat.h-remove-__GLIBC__-checks.patch
new file mode 100644
index 000..24a4199
--- /dev/null
+++ b/5.3/00_all_0001-linux-stat.h-remove-__GLIBC__-checks.patch
@@ -0,0 +1,28 @@
+From 1f4498530090a5fe7f6b2c46f2beb8818d7cb27b Mon Sep 17 00:00:00 2001
+From: Mike Frysinger 
+Date: Mon, 29 Dec 2008 06:52:59 -0500
+Subject: [PATCH] linux/stat.h: remove __GLIBC__ checks
+
+Only check __KERNEL__ so we don't assume the C library is glibc.
+
+Signed-off-by: Mike Frysinger 
+---
+ include/uapi/linux/stat.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/uapi/linux/stat.h b/include/uapi/linux/stat.h
+index 7b35e98d3c58..eb7474652d27 100644
+--- a/include/uapi/linux/stat.h
 b/include/uapi/linux/stat.h
+@@ -4,7 +4,7 @@
+ 
+ #include 
+ 
+-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
++#if defined(__KERNEL__)
+ 
+ #define S_IFMT  0017
+ #define S_IFSOCK 014
+-- 
+2.16.1
+

diff --git a/5.3/00_all_0002-netfilter-pull-in-limits.h.patch 
b/5.3/00_all_0002-netfilter-pull-in-limits.h.patch
new file mode 100644
index 000..9b5b2c0
--- /dev/null
+++ b/5.3/00_all_0002-netfilter-pull-in-limits.h.patch
@@ -0,0 +1,28 @@
+From 0e43763b07e10e2c3cb517349ac2d541bcb62e5a Mon Sep 17 00:00:00 2001
+From: Mike Frysinger 
+Date: Sat, 9 May 2009 17:30:35 -0400
+Subject: [PATCH] netfilter: pull in limits.h
+
+A few netfilter sub-headers use INT_MAX which is in limits.h.
+
+URL: http://bugs.gentoo.org/246160
+Signed-off-by: Mike Frysinger 
+---
+ include/uapi/linux/netfilter.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/uapi/linux/netfilter.h b/include/uapi/linux/netfilter.h
+index cca10e767cd8..de6d76399cd7 100644
+--- a/include/uapi/linux/netfilter.h
 b/include/uapi/linux/netfilter.h
+@@ -6,6 +6,7 @@
+ #include 
+ #include 
+ #include 
++#include 
+ 
+ /* Responses from hook functions. */
+ #define NF_DROP 0
+-- 
+2.16.1
+

diff --git a/5.3/00_all_0003-convert-PAGE_SIZE-usage.patch 
b/5.3/00_all_0003-convert-PAGE_SIZE-usage.patch
new file mode 100644
index 000..fbc2c45
--- /dev/null
+++ b/5.3/00_all_0003-convert-PAGE_SIZE-usage.patch
@@ -0,0 +1,54 @@
+From 25f2bcfa6c8a9e7cee2b92a823495479fe0ccc92 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger 
+Date: Sat, 13 Feb 2010 03:09:23 -0500
+Subject: [PATCH] convert PAGE_SIZE usage
+
+The size of a page may change at runtime or based on kernel settings, so
+a static value at compile time doesn't work.  More importantly, no one
+exports PAGE_SIZE to user space anymore.
+
+URL: http://bugs.gentoo.org/301431
+Signed-off-by: Mike Frysinger 
+---
+ include/uapi/linux/binfmts.h  | 3 ++-
+ include/uapi/linux/resource.h | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/include/uapi/linux/binfmts.h b/include/uapi/linux/binfmts.h
+index 4abad03a8853..3e98cfc84d1c 100644
+--- a/include/uapi/linux/binfmts.h
 b/include/uapi/linux/binfmts.h
+@@ -2,6 +2,7 @@
+ #ifndef _UAPI_LINUX_BINFMTS_H
+ #define _UAPI_LINUX_BINFMTS_H
+ 
++#include 
+ #include 
+ 
+ struct pt_regs;
+@@ -12,7 +13,7 @@ struct pt_regs;
+  * prevent the kernel from being unduly impacted by misaddressed pointers.
+  * MAX_ARG_STRINGS is chosen to fit in a signed 32-bit integer.
+  */
+-#define MAX_ARG_STRLEN (PAGE_SIZE * 32)
++#define MAX_ARG_STRLEN (sysconf(_SC_PAGESIZE) * 32)
+ #define MAX_ARG_STRINGS 0x7FFF
+ 
+ /* sizeof(linux_binprm->buf) */
+diff --git a/include/uapi/linux/resource.h b/include/uapi/linux/resource.h
+index cc00fd079631..6f9e76f513b5 100644
+--- a/include/uapi/linux/resource.h
 b/include/uapi/linux/resource.h
+@@ -69,7 +69,8 @@ struct rlimit64 {
+  * GPG2 wants 64kB of mlocked memory, to make sure pass phrases
+  * and other sensitive information are never written to disk.
+  */
+-#define MLOCK_LIMIT   ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024)
++/* No one currently defines PAGE_SIZE bigger than 64kB */
++#define