summaryrefslogtreecommitdiff
path: root/0001-support-sw_64-arch.patch
blob: 2e150e414693dc4eccdf1a8000ccbebf6f24ece6 (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
From 62d742713b0d6ed67fad52821541a7d83f4ce702 Mon Sep 17 00:00:00 2001
From: Funda Wang <fundawang@yeah.net>
Date: Sun, 12 Jan 2025 23:02:47 +0800
Subject: [PATCH] support sw_64 arch

---
 config.guess | 8 ++++++++
 config.sub   | 1 +
 2 files changed, 9 insertions(+)

diff --git a/config.guess b/config.guess
index 48a6846..b8fc0ac 100755
--- a/config.guess
+++ b/config.guess
@@ -1194,6 +1186,14 @@ EOF
     sparc:Linux:*:* | sparc64:Linux:*:*)
 	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
 	;;
+    sw_64:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
+	  sw)    UNAME_MACHINE=sw_64 ;;
+	esac
+	objdump --private-headers /bin/sh | grep -q ld.so.1
+	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+	GUESS=$UNAME_MACHINE-sunway-linux-$LIBC
+	;;
     tile*:Linux:*:*)
 	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
 	;;
diff --git a/config.sub b/config.sub
index 4aaae46..d49ee9b 100755
--- a/config.sub
+++ b/config.sub
@@ -1432,6 +1431,7 @@ case $cpu-$vendor in
 			| sparcv9v \
 			| spu \
 			| sv1 \
+			| sw_64 \
 			| sx* \
 			| tahoe \
 			| thumbv7* \
-- 
2.46.0