mbox series

[0/7] Compile-test UAPI and kernel headers

Message ID 20190701005845.12475-1-yamada.masahiro@socionext.com
Headers show
Series Compile-test UAPI and kernel headers | expand

Message

Masahiro Yamada July 1, 2019, 12:58 a.m. UTC
1/7: add CONFIG_CC_CAN_LINK to use it in 2/7

2/7: Compile-test exported headers

3/7: Do not generate intermediate wrappers.
     This will avoid header search path issue.

4/7: maybe useful for 7/7 and in some other places.
     Add header-test-pattern-y syntax.

5/7: Minor cleanup of gen_kheaders.sh

6/7: Exclude all files without ".h" extension
     from the kheaders_data.tar.xz
     This will be needed by 7/7 because we need to
     exclude "*.h.s" from the archive

7/7: Compile-test kernel-space headers in include/.


Masahiro Yamada (7):
  init/Kconfig: add CONFIG_CC_CAN_LINK
  kbuild: compile-test exported headers to ensure they are
    self-contained
  kbuild: do not create wrappers for header-test-y
  kbuild: support header-test-pattern-y
  kheaders: remove meaningless -R option of 'ls'
  kheaders: include only headers into kheaders_data.tar.xz
  kbuild: compile-test kernel headers to ensure they are self-contained

 .gitignore                         |    1 -
 Documentation/dontdiff             |    1 -
 Documentation/kbuild/makefiles.txt |   13 +-
 Makefile                           |    4 +-
 include/Kbuild                     | 1253 ++++++++++++++++++++++++++++
 init/Kconfig                       |   24 +
 kernel/gen_kheaders.sh             |   51 +-
 net/bpfilter/Kconfig               |    2 +-
 scripts/Makefile.build             |   10 +-
 scripts/Makefile.lib               |   13 +-
 usr/.gitignore                     |    1 -
 usr/Makefile                       |    2 +
 usr/include/.gitignore             |    3 +
 usr/include/Makefile               |  131 +++
 14 files changed, 1462 insertions(+), 47 deletions(-)
 create mode 100644 include/Kbuild
 create mode 100644 usr/include/.gitignore
 create mode 100644 usr/include/Makefile

-- 
2.17.1

Comments

Joel Fernandes (Google) July 2, 2019, 4:47 p.m. UTC | #1
On Mon, Jul 01, 2019 at 09:58:45AM +0900, Masahiro Yamada wrote:
> 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: Masahiro Yamada <yamada.masahiro@socionext.com>

> Tested-by: Jani Nikula <jani.nikula@intel.com>

> ---

> 

> Changes in v4:

>   - Fix vmlinux build error

>   - Exclude more headers for sparc

> 

> Changes in v3:

>   - Exclude more headers

>    (Tested for allnoconfig + CONFIG_HEADER_TEST=y)

> 

> Changes in v2:

>   - Add everything to test coverage, and exclude broken ones

>   - Rename 'Makefile' to 'Kbuild'

>   - Add CONFIG_KERNEL_HEADER_TEST option

> 

>  Makefile       |    1 +

>  include/Kbuild | 1253 ++++++++++++++++++++++++++++++++++++++++++++++++

>  init/Kconfig   |   11 +

>  3 files changed, 1265 insertions(+)

>  create mode 100644 include/Kbuild

[snip
> diff --git a/init/Kconfig b/init/Kconfig

> index 74192de8ada6..e2e99544da8d 100644

> --- a/init/Kconfig

> +++ b/init/Kconfig

> @@ -108,6 +108,17 @@ config HEADER_TEST

>  	  If you are a developer or tester and want to ensure the requested

>  	  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.


Nit:
							 modules.

Otherwise lgtm, thanks for the cc.

Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>