config-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Loongarch support


From: 武校田
Subject: [PATCH] Loongarch support
Date: Thu, 10 Dec 2020 20:25:37 +0800
User-agent: Mozilla/5.0 (X11; Linux mips64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

Hello!

This patch add support for recognizing LoongArch as a valid cpu in config.sub and config.guess.

I added test cases, and they all passed.

$ make check
cd testsuite && bash config-guess.sh && rm uname
cd testsuite && bash config-sub.sh
PASS: config.sub checks (821 tests)
PASS: config.sub idempotency checks (764 tests)
PASS: config.sub canonicalise each config.guess testcase (129 tests)
PASS: config.guess checks (129 tests)

We're porting downstream software, but almost every software needs to be modified, so hopefully this patch will be accepted here so that future automake versions can be used directly.

If I need to change / add anything, please let me know, thank you.

---

From 3366787d4995a9ba288372ffb211782fb20ee37c Mon Sep 17 00:00:00 2001
From: Xiaotian Wu <wuxiaotian@loongson.cn>
Date: Thu, 3 Dec 2020 14:18:08 +0800
Subject: [PATCH] Recgnize loongarch32, loongarch64 and loongarchx32

* config.guess (loongarch32:Linux:*:*, loongarch64:Linux:*:*, loongarchx32:Linux:*:*): New.
    * config.sub (loongarch32, loongarch64, loongarchx32): New.
* testsuite/config-sub.data: Add loongarch32, loongarch64, loongarchx32 test cases. * testsuite/config-guess.data: Add loongarch32, loongarch64, loongarchx32 test cases.
---
 config.guess                |  3 +++
 config.sub                  |  1 +
 testsuite/config-guess.data |  3 +++
 testsuite/config-sub.data   | 12 ++++++++++++
 4 files changed, 19 insertions(+)

diff --git a/config.guess b/config.guess
index 699b3a1..7154420 100755
     k1om:Linux:*:*)
     echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
     exit ;;
+    loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
+    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+    exit ;;
     m32r*:Linux:*:*)
     echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
     exit ;;
diff --git a/config.sub b/config.sub
index 19c9553..6ddd1ce 100755
--- a/config.sub
+++ b/config.sub
@@ -1185,6 +1185,7 @@ case $cpu-$vendor in
             | k1om \
             | le32 | le64 \
             | lm32 \
+            | loongarch32 | loongarch64 | loongarchx32 \
             | m32c | m32r | m32rle \
             | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
             | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
diff --git a/testsuite/config-guess.data b/testsuite/config-guess.data
index 2ce2d79..d7e7fc2 100644
--- a/testsuite/config-guess.data
+++ b/testsuite/config-guess.data
@@ -63,6 +63,9 @@ i86xen | 5.0 | AuroraUX | ignored | ignored | i386-pc-auroraux5.0
 i86xen | 5.6 | SunOS | ignored | ignored | i386-pc-solaris2.6
 IA64 | 6.0 | Interix | ignored | ignored | ia64-unknown-interix6.0
 k1om | 2.6.38 | Linux | ignored | ignored | k1om-unknown-linux-gnu
+loongarch32 | ignored | Linux | ignored | ignored | loongarch32-unknown-linux-gnu +loongarch64 | ignored | Linux | ignored | ignored | loongarch64-unknown-linux-gnu +loongarchx32 | ignored | Linux | ignored | ignored | loongarchx32-unknown-linux-gnu
 m88k | 7.0 | CX/UX | ignored | ignored | m88k-harris-cxux7
 macppc | 1.0 | MirBSD | ignored | ignored | powerpc-unknown-mirbsd1.0
 mips | 1.0 | OSF1 | ignored | ignored | mips-dec-osf1
diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data
index 82c9547..1648f69 100644
--- a/testsuite/config-sub.data
+++ b/testsuite/config-sub.data
@@ -315,6 +315,18 @@ leon sparc-leon-sunos4.1.1
 leon-wrs-vxworks                sparc-leon-vxworks
 lm32-elf                    lm32-unknown-elf
 lm32                        lm32-unknown-none
+loongarch32-company-elf                loongarch32-company-elf
+loongarch32-elf                    loongarch32-unknown-elf
+loongarch32-linux                loongarch32-unknown-linux-gnu
+loongarch32                    loongarch32-unknown-none
+loongarch64-company-elf                loongarch64-company-elf
+loongarch64-elf                    loongarch64-unknown-elf
+loongarch64-linux                loongarch64-unknown-linux-gnu
+loongarch64                    loongarch64-unknown-none
+loongarchx32-company-elf            loongarchx32-company-elf
+loongarchx32-elf                loongarchx32-unknown-elf
+loongarchx32-linux                loongarchx32-unknown-linux-gnu
+loongarchx32                    loongarchx32-unknown-none
 m3230                        mips-mips-sysv
 m32c-elf                    m32c-unknown-elf
 m32c                        m32c-unknown-none
--
2.28.0


--
Best Regards.

Xiaotian

Attachment: wuxiaotian.vcf
Description: Vcard


reply via email to

[Prev in Thread] Current Thread [Next in Thread]