Commit bbb3a0dc authored by Hongchen Zhang's avatar Hongchen Zhang
Browse files

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 <asm/orc_types.h>
      |          ^~~~~~~~~~~~~~~~~
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: 4efd0de6 ("tools/perf: Add basic support for LoongArch")
Signed-off-by: default avatarHongchen Zhang <zhanghongchen@loongson.cn>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parent b8dfd735
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -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