From 218bb7051e4051e150616eb0916004218475cc77 Mon Sep 17 00:00:00 2001 From: wuruilong Date: Mon, 18 Sep 2023 08:24:13 +0000 Subject: [PATCH] Add support for loongarch --- src/architecture.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/architecture.h b/src/architecture.h index 2d2daa7..cbf1795 100644 --- a/src/architecture.h +++ b/src/architecture.h @@ -58,6 +58,7 @@ enum { ARCHITECTURE_TILEGX, ARCHITECTURE_CRIS, ARCHITECTURE_RISCV64, + ARCHITECTURE_LOONGARCH, _ARCHITECTURE_MAX, _ARCHITECTURE_INVALID = -1 }; @@ -150,6 +151,9 @@ int uname_architecture(void); #elif defined(__riscv) && __riscv_xlen == 64 # define native_architecture() ARCHITECTURE_RISCV64 # define define LIB_ARCH_TUPLE "riscv64-linux-gnu" +#elif defined(__loongarch__) && __loongarch_grlen == 64 +# define native_architecture() ARCHITECTURE_LOONGARCH +# define define LIB_ARCH_TUPLE "loongarch64-linux-gnu" #elif defined(__aarch64__) # if __BYTE_ORDER == __BIG_ENDIAN # define native_architecture() ARCHITECTURE_ARM64_BE