linux/usr/include
Masahiro Yamada 9fbed27a7a kbuild: add --target to correctly cross-compile UAPI headers with Clang
When you compile-test UAPI headers (CONFIG_UAPI_HEADER_TEST=y) with
Clang, they are currently compiled for the host target (likely x86_64)
regardless of the given ARCH=.

In fact, some exported headers include libc headers. For example,
include/uapi/linux/agpgart.h includes <stdlib.h> after being exported.
The header search paths should match to the target we are compiling
them for.

Pick up the --target triple from KBUILD_CFLAGS in the same ways as
commit 7f58b487e9 ("kbuild: make Clang build userprogs for target
architecture").

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
2022-03-31 12:03:46 +09:00
..
.gitignore usr/include: refactor .gitignore 2021-05-02 00:43:34 +09:00
headers_check.pl kbuild: move headers_check.pl to usr/include/ 2022-01-08 17:41:00 +09:00
Makefile kbuild: add --target to correctly cross-compile UAPI headers with Clang 2022-03-31 12:03:46 +09:00