Skip to content

Commit 5ddc7a3

Browse files
xen0nchenhuacai
authored andcommitted
LoongArch: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation
This is a port of commit 08f6554 ("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 <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Link: ClangBuiltLinux/linux#1787 (comment) Signed-off-by: WANG Xuerui <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent b89673a commit 5ddc7a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/loongarch/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ KBUILD_CFLAGS += -isystem $(shell $(CC) -print-file-name=include)
112112
KBUILD_LDFLAGS += -m $(ld-emul)
113113

114114
ifdef CONFIG_LOONGARCH
115-
CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
115+
CHECKFLAGS += $(shell $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
116116
grep -E -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
117117
sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g')
118118
endif

0 commit comments

Comments
 (0)