<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/usr/dummy-include, branch master</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>kbuild: uapi: provide a C++ compatible dummy definition of NULL</title>
<updated>2026-03-25T12:24:41+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2026-03-16T16:52:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b187c1a1a0513593663b1adee0340d41d833d16d'/>
<id>b187c1a1a0513593663b1adee0340d41d833d16d</id>
<content type='text'>
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 &lt;linux@weissschuh.net&gt;
Reviewed-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Link: https://patch.msgid.link/20260316-kbuild-uapi-c-v2-4-35d6d0ed863f@weissschuh.net
Signed-off-by: Nicolas Schier &lt;nsc@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;linux@weissschuh.net&gt;
Reviewed-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Link: https://patch.msgid.link/20260316-kbuild-uapi-c-v2-4-35d6d0ed863f@weissschuh.net
Signed-off-by: Nicolas Schier &lt;nsc@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kbuild: uapi: remove now unneeded guard headers</title>
<updated>2026-03-12T11:48:09+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2026-02-27T06:38:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=febb5c81fa8df999e24877f6226f8cba9f06ce6a'/>
<id>febb5c81fa8df999e24877f6226f8cba9f06ce6a</id>
<content type='text'>
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 &lt;linux@weissschuh.net&gt;
Reviewed-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Nicolas Schier &lt;nsc@kernel.org&gt;
Tested-by: Nicolas Schier &lt;nsc@kernel.org&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: https://patch.msgid.link/20260227-kbuild-uapi-libc-v1-9-c17de0d19776@weissschuh.net
Signed-off-by: Nicolas Schier &lt;nsc@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;linux@weissschuh.net&gt;
Reviewed-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Nicolas Schier &lt;nsc@kernel.org&gt;
Tested-by: Nicolas Schier &lt;nsc@kernel.org&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: https://patch.msgid.link/20260227-kbuild-uapi-libc-v1-9-c17de0d19776@weissschuh.net
Signed-off-by: Nicolas Schier &lt;nsc@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kbuild: uapi: provide stub includes for some libc headers</title>
<updated>2026-03-12T11:48:08+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2026-02-27T06:38:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=aad94ba683adc6ff7ff4e29ae48184b42782dd97'/>
<id>aad94ba683adc6ff7ff4e29ae48184b42782dd97</id>
<content type='text'>
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 &lt;linux@weissschuh.net&gt;
Reviewed-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Nicolas Schier &lt;nsc@kernel.org&gt;
Tested-by: Nicolas Schier &lt;nsc@kernel.org&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: https://patch.msgid.link/20260227-kbuild-uapi-libc-v1-6-c17de0d19776@weissschuh.net
Signed-off-by: Nicolas Schier &lt;nsc@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;linux@weissschuh.net&gt;
Reviewed-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Reviewed-by: Nicolas Schier &lt;nsc@kernel.org&gt;
Tested-by: Nicolas Schier &lt;nsc@kernel.org&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: https://patch.msgid.link/20260227-kbuild-uapi-libc-v1-6-c17de0d19776@weissschuh.net
Signed-off-by: Nicolas Schier &lt;nsc@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kbuild: prevent exported headers from including &lt;stdlib.h&gt;, &lt;stdbool.h&gt;</title>
<updated>2022-05-13T08:56:10+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2022-04-04T06:19:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=02a6e4be2ff44344f58b078c18dc3ab3877fcfe5'/>
<id>02a6e4be2ff44344f58b078c18dc3ab3877fcfe5</id>
<content type='text'>
Some UAPI headers included &lt;stdlib.h&gt;, like this:

  #ifndef __KERNEL__
  #include &lt;stdlib.h&gt;
  #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 &lt;stdlib.h&gt; 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 &lt;stdlib.h&gt;, 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 &lt;stdbool.h&gt;. I put it as well before somebody
attempts to use it.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some UAPI headers included &lt;stdlib.h&gt;, like this:

  #ifndef __KERNEL__
  #include &lt;stdlib.h&gt;
  #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 &lt;stdlib.h&gt; 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 &lt;stdlib.h&gt;, 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 &lt;stdbool.h&gt;. I put it as well before somebody
attempts to use it.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
