From bbb3a0dc4769e187f9c1583c3b755e1228e5ac16 Mon Sep 17 00:00:00 2001 From: Hongchen Zhang Date: Tue, 14 Mar 2023 11:42:33 +0800 Subject: [PATCH] fix compile error introduced by LoongArch commit LoongArch inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6MV9N -------------------------------- when compile kernel using the following steps: make allmodconfig ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- make oldconfig ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- make -j64 ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- we get error: DESCEND objtool HOSTCC scripts/sorttable In file included from scripts/sorttable.c:195: scripts/sorttable.h:89:10: fatal error: asm/orc_types.h: No such file or directory 89 | #include | ^~~~~~~~~~~~~~~~~ compilation terminated. make[1]: *** [scripts/Makefile.host:95: scripts/sorttable] Error 1 make: *** [Makefile:1215: scripts] Error 2 make: *** Waiting for unfinished jobs.... the reason is ARCH a command-line variable,the normal assignment is ignored.So split loongarch architecture from others. Fixes: 4efd0de66c6f ("tools/perf: Add basic support for LoongArch") Signed-off-by: Hongchen Zhang Signed-off-by: Zheng Zengkai Signed-off-by: Jialin Zhang --- scripts/Makefile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/scripts/Makefile b/scripts/Makefile index 5d89c2ee2748..495ea6ce00e9 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -24,20 +24,19 @@ HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS) HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS) ifdef CONFIG_UNWINDER_ORC -# Additional ARCH settings for x86 +ifneq ($(filter loongarch loongarch64, $(ARCH)),) +HOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/loongarch/include +HOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED +HOSTLDLIBS_sorttable = -lpthread +else ifeq ($(ARCH),x86_64) ARCH := x86 endif - -# Additional ARCH settings for loongarch -ifeq ($(ARCH),loongarch64) -ARCH := loongarch -endif - -HOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/$(ARCH)/include +HOSTCFLAGS_sorttable.o += -I$(srctree)/tools/arch/x86/include HOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED HOSTLDLIBS_sorttable = -lpthread endif +endif # The following programs are only built on demand hostprogs += unifdef -- GitLab