summaryrefslogtreecommitdiff
path: root/Add-loongarch-architecture-support.patch
blob: 80c9c41a2e7b3c6469798fec4314c02114d50a5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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 12339fc..74c50a2 100755
--- a/installplatform
+++ b/installplatform
@@ -168,6 +168,18 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do
 	CANONARCH=mips64r6el
 	CANONCOLOR=3
 	;;
+    loongarch32)
+	ISANAME=loongarch
+	ISABITS=32
+	CANONARCH=loongarch32
+	CANONCOLOR=0
+	;;
+    loongarch64)
+	ISANAME=loongarch
+	ISABITS=64
+	CANONARCH=loongarch64
+	CANONCOLOR=3
+	;;
     m68k)
 	ISANAME=m68k
 	ISABITS=32
diff --git a/rpmrc.in b/rpmrc.in
index 5bd9ba3..fc2932a 100644
--- a/rpmrc.in
+++ b/rpmrc.in
@@ -67,6 +67,8 @@ optflags: mipsr6el -O2 -g
 optflags: mips64r6 -O2 -g
 optflags: mips64r6el -O2 -g
 
+optflags: loongarch64 -O2 -g
+
 optflags: armv3l -O2 -g -march=armv3
 optflags: armv4b -O2 -g -march=armv4
 optflags: armv4l -O2 -g -march=armv4
@@ -137,6 +139,9 @@ archcolor: mipsr6el 1
 archcolor: mips64r6 2
 archcolor: mips64r6el 2
 
+archcolor: loongarch32 1
+archcolor: loongarch64 2
+
 archcolor: m68k 1
 
 archcolor: m68kmint 1
@@ -257,6 +262,9 @@ arch_canon:	mips64r6el: mips64r6el	21
 arch_canon:	riscv: riscv64	22
 arch_canon:	riscv64: riscv64	22
 
+arch_canon:	loongarch32:	loongarch32	25
+arch_canon:	loongarch64:	loongarch64	26
+
 #############################################################
 # Canonical OS names and numbers
 
@@ -360,6 +368,9 @@ buildarchtranslate: mipsr6el: mipsr6el
 buildarchtranslate: mips64r6: mips64r6
 buildarchtranslate: mips64r6el: mips64r6el
 
+buildarchtranslate: loongarch32: loongarch32
+buildarchtranslate: loongarch64: loongarch64
+
 buildarchtranslate: m68k: m68k
 
 buildarchtranslate: atarist: m68kmint
@@ -449,6 +460,9 @@ arch_compat: mipsr6el: noarch
 arch_compat: mips64r6: mipsr6
 arch_compat: mips64r6el: mipsr6el
 
+arch_compat: loongarch32: noarch
+arch_compat: loongarch64: loongarch32
+
 arch_compat: hppa2.0: hppa1.2
 arch_compat: hppa1.2: hppa1.1
 arch_compat: hppa1.1: hppa1.0
@@ -586,6 +600,9 @@ buildarch_compat: mipsr6el: noarch
 buildarch_compat: mips64r6: noarch
 buildarch_compat: mips64r6el: noarch
 
+buildarch_compat: loongarch32: noarch
+buildarch_compat: loongarch64: noarch
+
 buildarch_compat: armv4b: noarch
 buildarch_compat: armv8l: armv7l
 buildarch_compat: armv7l: armv6l
-- 
2.30.0