From 40e163fbe8f442c954150bd66797b231b42626f7 Mon Sep 17 00:00:00 2001 From: diviocity Date: Sun, 29 Nov 2026 23:15:03 +0100 Subject: [PATCH] linux-headers: export architecture-specific userspace ABI headers from source --- ...e-inclusion-of-sysinfo.h-in-kernel.h.patch | 29 +++++++++++++++++ linux-headers/PKGBUILD.vile | 32 +++++++++++++++++++ linux-headers/revert-broken-uapi.patch | 18 +++++++++++ 3 files changed, 79 insertions(+) create mode 100644 linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch create mode 100644 linux-headers/PKGBUILD.vile create mode 100644 linux-headers/revert-broken-uapi.patch diff --git a/linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch b/linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch new file mode 100644 index 0000000..f3381c4 --- /dev/null +++ b/linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch @@ -0,0 +1,29 @@ +From 8e69b663d6ddef132041a1186f081fdd74d4a31d Mon Sep 17 00:00:00 2001 +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. +--- +Signed-off-by: Khem Raj +Upstream-Status: Submitted + + include/uapi/linux/kernel.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h +index fadf2db71fe8..813800ed141f 100644 +--- 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/linux-headers/PKGBUILD.vile b/linux-headers/PKGBUILD.vile new file mode 100644 index 0000000..41e8d75 --- /dev/null +++ b/linux-headers/PKGBUILD.vile @@ -0,0 +1,32 @@ +defpkgbuild(linux-headers, + #:pkgname, "linux-headers", + #:pkgver, "6.6", + #:pkgrel, 1, + #:pkgdesc, "Linux userspace ABI headers for compiling Vinix programs", + #:arch, [#:x86-64, #:aarch64], + #:license, "GPL-2.0-only WITH Linux-syscall-note", + #:url, "https://kernel.org/", + #:source, ["https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.6.tar.xz", + "revert-broken-uapi.patch", "0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch"], + #:sha256sums, ["d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0", + "b7a4fa8cb01645f1e96cd165d89e637de90594e39a5848003c386d6424b1def2", + "e9827c3f919866bb63b05b9eeacfc8e04f560f467c9456e7b283f432b5dc9a7e"], + #:prepare, fn() { + for-each(fn(patch) { + run("patch", "--batch", "--fuzz=0", "-d", "linux-6.6", "-p1", "-i", string-append("../", patch)) + }, list("revert-broken-uapi.patch", "0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch")) + }, + #:build, fn() { + run("make", "-C", "linux-6.6", "headers") + }, + #:package, fn() { + run("make", "-C", "linux-6.6", "headers_install", string-append("INSTALL_HDR_PATH=", pkgdir(), "/usr")) + ; libdrm supplies its own DRM interface headers in the graphics sysroot. + run("rm", "-rf", string-append(pkgdir(), "/usr/include/drm")) + run("test", "-s", string-append(pkgdir(), "/usr/include/asm/unistd.h")) + run("test", "-s", string-append(pkgdir(), "/usr/include/linux/vt.h")) + run("install", "-Dm644", "linux-6.6/LICENSES/exceptions/Linux-syscall-note", + string-append(pkgdir(), "/usr/share/licenses/linux-headers/Linux-syscall-note")) + run("install", "-Dm644", "linux-6.6/LICENSES/preferred/GPL-2.0", + string-append(pkgdir(), "/usr/share/licenses/linux-headers/GPL-2.0")) + }) diff --git a/linux-headers/revert-broken-uapi.patch b/linux-headers/revert-broken-uapi.patch new file mode 100644 index 0000000..186ef71 --- /dev/null +++ b/linux-headers/revert-broken-uapi.patch @@ -0,0 +1,18 @@ +Revert 1fe8e0f074c77aa41aaa579345a9e675acbebfa9 +diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h +index 1046f55..777b6cd 100644 +--- a/include/uapi/linux/if_tunnel.h ++++ b/include/uapi/linux/if_tunnel.h +@@ -2,9 +2,6 @@ + #define _UAPI_IF_TUNNEL_H_ + + #include +-#include +-#include +-#include + #include + + +-- +cgit v1.1 + -- 2.56.1