From 3100da59abd272fc3f301a30ebabedf86b0b4a00 Mon Sep 17 00:00:00 2001
From: Sun Haiyong <sunhaiyong@loongson.cn>
Date: Tue, 21 Dec 2021 20:40:27 +0800
Subject: [PATCH] Add loongarch architecture support.

---
 installplatform | 12 ++++++++++++
 rpmrc.in        | 17 +++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/installplatform b/installplatform
index ddcaa6d..fd37b0c 100755
--- a/installplatform
+++ b/installplatform
@@ -180,6 +180,12 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do
 	CANONARCH=riscv64
 	CANONCOLOR=3
 	;;
+    loongarch32)
+	ISANAME=loongarch
+	ISABITS=32
+	CANONARCH=loongarch32
+	CANONCOLOR=0
+	;;
     loongarch64)
 	ISANAME=loongarch
 	ISABITS=64
diff --git a/rpmrc.in b/rpmrc.in
index 6861b0a..74caf90 100644
--- a/rpmrc.in
+++ b/rpmrc.in
@@ -157,7 +157,7 @@ archcolor: aarch64 2
 archcolor: aarch64_ilp32 1
 archcolor: riscv64 2
 
-
+archcolor: loongarch32 1
 archcolor: loongarch64 2
 
 #############################################################
@@ -263,6 +263,7 @@ arch_canon:	riscv: riscv64	22
 arch_canon:	riscv64: riscv64	22
 
 arch_canon:	loongarch64:	loongarch64	23
+arch_canon:	loongarch32:	loongarch32	24
 
 #############################################################
 # Canonical OS names and numbers
@@ -395,6 +396,7 @@ buildarchtranslate: aarch64_ilp32: aarch64_ilp32
 buildarchtranslate: riscv: riscv64
 buildarchtranslate: riscv64: riscv64
 
+buildarchtranslate: loongarch32: loongarch32
 buildarchtranslate: loongarch64: loongarch64
 
 #########################################/####################
@@ -538,6 +540,7 @@ os_compat: bsdi4.0: bsdi
 
 os_compat: Darwin: MacOSX
 
+arch_compat: loongarch32: noarch
 arch_compat: loongarch64: noarch
 
 buildarch_compat: ia64: noarch
@@ -645,6 +648,7 @@ buildarch_compat: sh4: noarch
 buildarch_compat: sh4a: sh4
 
 
+buildarch_compat: loongarch32: noarch
 buildarch_compat: loongarch64: noarch
 
 # \endverbatim
-- 
2.27.0

