mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
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 <linux@weissschuh.net> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Nicolas Schier <nsc@kernel.org> Tested-by: Nicolas Schier <nsc@kernel.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Link: https://patch.msgid.link/20260227-kbuild-uapi-libc-v1-6-c17de0d19776@weissschuh.net Signed-off-by: Nicolas Schier <nsc@kernel.org>
13 lines
307 B
C
13 lines
307 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
#ifndef _DUMMY_STRING_H
|
|
#define _DUMMY_STRING_H
|
|
|
|
#include <stddef.h>
|
|
|
|
#define memset(_s, _c, _n) __builtin_memset(_s, _c, _n)
|
|
#define memcpy(_dest, _src, _n) __builtin_memcpy(_dest, _src, _n)
|
|
|
|
#define strlen(_s) __builtin_strlen(_s)
|
|
|
|
#endif /* _DUMMY_STRING_H */
|