From d7484395ac0fd85c91365beb4af00c6e5ea39ee6 Mon Sep 17 00:00:00 2001
From: Xue Liu <liuxue@loongson.cn>
Date: Thu, 1 Dec 2022 18:39:44 +0800
Subject: [PATCH 3/3] build: Specify the target build architecture for
 LOONGARCH.

More information about LoongArch:
- https://loongson.github.io/LoongArch-Documentation/README-EN.html

Signed-off-by: Xue Liu <liuxue@loongson.cn>
Change-Id: I24852e31b5fadef3578354da2d26252014330e83
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16084
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
---
 mk/spdk.common.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk
index da214c8..1e73776 100644
--- a/mk/spdk.common.mk
+++ b/mk/spdk.common.mk
@@ -80,6 +80,9 @@ COMMON_CFLAGS += -mcpu=$(TARGET_ARCHITECTURE)
 else ifeq ($(TARGET_MACHINE),aarch64)
 COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
 COMMON_CFLAGS += -DPAGE_SIZE=$(shell getconf PAGESIZE)
+else ifneq ($(filter loongarch%,$(TARGET_MACHINE)),)
+COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
+COMMON_CFLAGS += -DPAGE_SIZE=$(shell getconf PAGESIZE)
 else
 COMMON_CFLAGS += -march=core-avx-i
 endif
-- 
2.20.1

