From aad94ba683adc6ff7ff4e29ae48184b42782dd97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Fri, 27 Feb 2026 07:38:04 +0100 Subject: kbuild: uapi: provide stub includes for some libc headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some UAPI headers incorrectly use libc headers. To compile-test these UAPI headers, their respective libc dependencies need to be present. Not all kernel toolchains provide these headers, reducing test coverage. Introduce some stub headers which provide just enough symbols to test all UAPI headers. Most headers are empty anyways, as their symbols are only used in macros which are not actually evaluated. As these headers are only ever used with newer kernel toolchains, they can defer to compiler builtins in many cases. As more UAPI headers are cleaned up to not require these stubs anymore, they can be removed again. Signed-off-by: Thomas Weißschuh Reviewed-by: Nathan Chancellor Reviewed-by: Nicolas Schier Tested-by: Nicolas Schier Acked-by: Arnd Bergmann Link: https://patch.msgid.link/20260227-kbuild-uapi-libc-v1-6-c17de0d19776@weissschuh.net Signed-off-by: Nicolas Schier --- usr/dummy-include/sys/ioctl.h | 0 usr/dummy-include/sys/socket.h | 12 ++++++++++++ usr/dummy-include/sys/time.h | 3 +++ usr/dummy-include/sys/types.h | 0 4 files changed, 15 insertions(+) create mode 100644 usr/dummy-include/sys/ioctl.h create mode 100644 usr/dummy-include/sys/socket.h create mode 100644 usr/dummy-include/sys/time.h create mode 100644 usr/dummy-include/sys/types.h (limited to 'usr/dummy-include/sys') diff --git a/usr/dummy-include/sys/ioctl.h b/usr/dummy-include/sys/ioctl.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/usr/dummy-include/sys/socket.h b/usr/dummy-include/sys/socket.h new file mode 100644 index 000000000000..748751f9e53e --- /dev/null +++ b/usr/dummy-include/sys/socket.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef _DUMMY_SYS_SOCKET_H +#define _DUMMY_SYS_SOCKET_H + +#include + +struct sockaddr { + __kernel_sa_family_t sa_family; /* address family, AF_xxx */ + char sa_data[14]; /* 14 bytes of protocol address */ +}; + +#endif /* _DUMMY_SYS_SOCKET_H */ diff --git a/usr/dummy-include/sys/time.h b/usr/dummy-include/sys/time.h new file mode 100644 index 000000000000..9817b8afb1a6 --- /dev/null +++ b/usr/dummy-include/sys/time.h @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include diff --git a/usr/dummy-include/sys/types.h b/usr/dummy-include/sys/types.h new file mode 100644 index 000000000000..e69de29bb2d1 -- cgit v1.2.3