kbuild: compile-test exported headers to ensure they are self-contained
Multiple people have suggested compile-testing UAPI headers to ensure they can be really included from user-space. "make headers_check" is obviously not enough to catch bugs, and we often leak unresolved references to user-space. Use the new header-test-y syntax to implement it. Please note exported headers are compile-tested with a completely different set of compiler flags. The header search path is set to $(objtree)/usr/include since exported headers should not include unexported ones. We use -std=gnu89 for the kernel space since the kernel code highly depends on GNU extensions. On the other hand, UAPI headers should be written in more standardized C, so they are compiled with -std=c90. This will emit errors if C++ style comments, the keyword 'inline', etc. are used. Please use C style comments (/* ... */), '__inline__', etc. in UAPI headers. There is additional compiler requirement to enable this test because many of UAPI heade...
Showing
- Makefile 1 addition, 1 deletionMakefile
- init/Kconfig 10 additions, 0 deletionsinit/Kconfig
- usr/.gitignore 0 additions, 1 deletionusr/.gitignore
- usr/Makefile 2 additions, 0 deletionsusr/Makefile
- usr/include/.gitignore 3 additions, 0 deletionsusr/include/.gitignore
- usr/include/Makefile 132 additions, 0 deletionsusr/include/Makefile
Please register or sign in to comment