Commit 43c78d88 authored by Masahiro Yamada's avatar Masahiro Yamada

kbuild: compile-test kernel headers to ensure they are self-contained

The headers in include/ are globally used in the kernel source tree
to provide common APIs. They are included from external modules, too.

It will be useful to make as many headers self-contained as possible
so that we do not have to rely on a specific include order.

There are more than 4000 headers in include/. In my rough analysis,
70% of them are already self-contained. With efforts, most of them
can be self-contained.

For now, we must exclude more than 1000 headers just because they
cannot be compiled as standalone units. I added them to header-test-.
The blacklist was mostly generated by a script, so the reason of the
breakage should be checked later.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarJoel Fernandes (Google) <joel@joelfernandes.org>
parent 7199ff7d
...@@ -618,6 +618,7 @@ ifeq ($(KBUILD_EXTMOD),) ...@@ -618,6 +618,7 @@ ifeq ($(KBUILD_EXTMOD),)
init-y := init/ init-y := init/
drivers-y := drivers/ sound/ drivers-y := drivers/ sound/
drivers-$(CONFIG_SAMPLES) += samples/ drivers-$(CONFIG_SAMPLES) += samples/
drivers-$(CONFIG_KERNEL_HEADER_TEST) += include/
net-y := net/ net-y := net/
libs-y := lib/ libs-y := lib/
core-y := usr/ core-y := usr/
......
This diff is collapsed.
...@@ -108,6 +108,17 @@ config HEADER_TEST ...@@ -108,6 +108,17 @@ config HEADER_TEST
If you are a developer or tester and want to ensure the requested If you are a developer or tester and want to ensure the requested
headers are self-contained, say Y here. Otherwise, choose N. headers are self-contained, say Y here. Otherwise, choose N.
config KERNEL_HEADER_TEST
bool "Compile test kernel headers"
depends on HEADER_TEST
help
Headers in include/ are used to build external moduls.
Compile test them to ensure they are self-contained, i.e.
compilable as standalone units.
If you are a developer or tester and want to ensure the headers
in include/ are self-contained, say Y here. Otherwise, choose N.
config UAPI_HEADER_TEST config UAPI_HEADER_TEST
bool "Compile test UAPI headers" bool "Compile test UAPI headers"
depends on HEADER_TEST && HEADERS_INSTALL && CC_CAN_LINK depends on HEADER_TEST && HEADERS_INSTALL && CC_CAN_LINK
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment