summaryrefslogtreecommitdiffstats
path: root/tools/scripts
diff options
context:
space:
mode:
authorHuacai Chen <chenhuacai@loongson.cn>2023-02-25 15:52:57 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2023-02-25 22:12:18 +0800
commit121ff07bdee06555835e26499f5c125223a6beb3 (patch)
tree0ccbc6c9204f9af5888151fa6a1b246accca56b6 /tools/scripts
parenta6484baa3b02b9d71bfd6016e7632dd1c02d5cba (diff)
downloadlinux-stable-121ff07bdee06555835e26499f5c125223a6beb3.tar.gz
linux-stable-121ff07bdee06555835e26499f5c125223a6beb3.tar.bz2
linux-stable-121ff07bdee06555835e26499f5c125223a6beb3.zip
tools: Add LoongArch build infrastructure
We will add tools support for LoongArch (bpf, perf, objtool, etc.), add build infrastructure and common headers for preparation. Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'tools/scripts')
-rw-r--r--tools/scripts/Makefile.arch11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/scripts/Makefile.arch b/tools/scripts/Makefile.arch
index 0c6c7f456887..1c72d07cb9fe 100644
--- a/tools/scripts/Makefile.arch
+++ b/tools/scripts/Makefile.arch
@@ -5,7 +5,7 @@ HOSTARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
-e s/s390x/s390/ -e s/parisc64/parisc/ \
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
-e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
- -e s/riscv.*/riscv/)
+ -e s/riscv.*/riscv/ -e s/loongarch.*/loongarch/)
ifndef ARCH
ARCH := $(HOSTARCH)
@@ -34,6 +34,15 @@ ifeq ($(ARCH),sh64)
SRCARCH := sh
endif
+# Additional ARCH settings for loongarch
+ifeq ($(ARCH),loongarch32)
+ SRCARCH := loongarch
+endif
+
+ifeq ($(ARCH),loongarch64)
+ SRCARCH := loongarch
+endif
+
LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
ifeq ($(LP64), 1)
IS_64_BIT := 1