summaryrefslogtreecommitdiff
path: root/usr/dummy-include
AgeCommit message (Collapse)Author
2026-03-25kbuild: uapi: provide a C++ compatible dummy definition of NULLThomas Weißschuh
NULL works differently in C++ compared to C. To allow testing the UAPI headers against C++ compilers, provide a variant of NULL which works with those. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Link: https://patch.msgid.link/20260316-kbuild-uapi-c-v2-4-35d6d0ed863f@weissschuh.net Signed-off-by: Nicolas Schier <nsc@kernel.org>
2026-03-12kbuild: uapi: remove now unneeded guard headersThomas Weißschuh
The test compilation does not allow usage of the toolchain headers anymore, so these dummy headers are not needed anymore. 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-9-c17de0d19776@weissschuh.net Signed-off-by: Nicolas Schier <nsc@kernel.org>
2026-03-12kbuild: uapi: provide stub includes for some libc headersThomas Weißschuh
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>
2022-05-13kbuild: prevent exported headers from including <stdlib.h>, <stdbool.h>Masahiro Yamada
Some UAPI headers included <stdlib.h>, like this: #ifndef __KERNEL__ #include <stdlib.h> #endif As it turned out, they just included it for no good reason. After some fixes, now I can compile-test UAPI headers (CONFIG_UAPI_HEADER_TEST=y) without including <stdlib.h> from the system header search paths. To avoid somebody getting it back again, this commit adds the dummy header, usr/dummy-include/stdlib.h I added $(srctree)/usr/dummy-include to the header search paths. Because it is searched before the system directories, if someone tries to include <stdlib.h>, they will see the error message. While I am here, I also replaced $(objtree)/usr/include with $(obj), but it has no functional change. If we can make kernel headers self-contained (that is, none of exported kernel headers includes system headers), we will be able to add the -nostdinc flag, but that is much far from where we stand now. As a realistic solution, we can ban header inclusion individually by putting a dummy header into usr/dummy-include/. Currently, no header include <stdbool.h>. I put it as well before somebody attempts to use it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>