aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch
diff options
context:
space:
mode:
authorWANG Xuerui <git@xen0n.name>2023-06-29 20:58:43 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2023-06-29 20:58:43 +0800
commit5ddc7a3794ddd3470635ebd325fa1dffea5b18c0 (patch)
tree1af74db99be815e614fde88744a9c0978057d146 /arch
parentLoongArch: vDSO: Use CLANG_FLAGS instead of filtering out '--target=' (diff)
downloadwireguard-linux-5ddc7a3794ddd3470635ebd325fa1dffea5b18c0.tar.xz
wireguard-linux-5ddc7a3794ddd3470635ebd325fa1dffea5b18c0.zip
LoongArch: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation
This is a port of commit 08f6554ff90e ("mips: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation") to arch/loongarch, for fixing cross-compilation of Linux/LoongArch with Clang, where previously the `--target` flag would no longer be present for the CHECKFLAGS cc invocation leading to build failure. Reported-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Link: https://github.com/ClangBuiltLinux/linux/issues/1787#issuecomment-1608306002 Signed-off-by: WANG Xuerui <git@xen0n.name> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch')
-rw-r--r--arch/loongarch/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
index a63683da3bcf..09ba338a64de 100644
--- a/arch/loongarch/Makefile
+++ b/arch/loongarch/Makefile
@@ -112,7 +112,7 @@ KBUILD_CFLAGS += -isystem $(shell $(CC) -print-file-name=include)
KBUILD_LDFLAGS += -m $(ld-emul)
ifdef CONFIG_LOONGARCH
-CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
+CHECKFLAGS += $(shell $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
grep -E -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g')
endif