Hello GNU config maintainers, This patch adds support for the sw_64 architecture.
sw_64 is a RISC‑like ISA, similar to RISC‑V and LoongArch. Although relatively new, it has been supported by openEuler and openAnolis since 2020, so adding support here is valuable. This PR fixes compilation failures on the sw_64 platform. Binutils assigns EM_SW64 the e_machine value 268, which this patch also adopts. Reference: https://en.wikipedia.org/wiki/Sunway_(processor) Please consider accepting this patch. Thanks.
From 0218ecc5c46948e2a978507eca694e18b13ba0fe Mon Sep 17 00:00:00 2001 From: "zheny.ji" <[email protected]> Date: Tue, 19 Aug 2025 15:45:48 +0800 Subject: [PATCH] Recognize sw_64 platform * config.guess (sw_64:Linux:*:*, sw64:Linux:*:*): Recognize. * config.sub (sw_64, sw64): Likewise. * testsuite/config-guess.data: Add test cases for sw_64, sw64. --- config.guess | 3 +++ config.sub | 2 ++ testsuite/config-guess.data | 2 ++ testsuite/config-sub.data | 2 ++ 4 files changed, 9 insertions(+) diff --git a/config.guess b/config.guess index a9d01fd..09c5f6d 100755 --- a/config.guess +++ b/config.guess @@ -1027,6 +1027,9 @@ EOF arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; + sw_64:Linux:*:* | sw64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ diff --git a/config.sub b/config.sub index 3d35cde..f6bda95 100755 --- a/config.sub +++ b/config.sub @@ -1264,6 +1264,8 @@ case $cpu-$vendor in | alphaev6[78] \ | alphaev[4-8] \ | alphapca5[67] \ + | sw_64 \ + | sw64 \ | am33_2.0 \ | amdgcn \ | arc \ diff --git a/testsuite/config-guess.data b/testsuite/config-guess.data index b968943..b8c443d 100644 --- a/testsuite/config-guess.data +++ b/testsuite/config-guess.data @@ -127,6 +127,8 @@ riscv64be | ignored | Linux | ignored | ignored | riscv64be-unknown-linux-gnu s390x | 5.6 | SunOS | ignored | ignored | s390x-ibm-solaris2.6 sun3 | 4.0 | SunOS | ignored | ignored | m68k-sun-sunos4.0 sun4 | 5.6 | SunOS | ignored | ignored | sparc-sun-solaris2.6 +sw_64 | ignored | Linux | ignored | ignored | sw_64-unknown-linux-gnu +sw64 | ignored | Linux | ignored | ignored | sw64-unknown-linux-gnu tadpole | 5.6 | SunOS | ignored | ignored | sparc-sun-solaris2.6 tile | 2.6.36 | Linux | ignored | ignored | tile-unknown-linux-gnu tilegx | 2.6.36 | Linux | ignored | ignored | tilegx-unknown-linux-gnu diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data index 93b403c..be950b8 100644 --- a/testsuite/config-sub.data +++ b/testsuite/config-sub.data @@ -908,6 +908,8 @@ rs6000-bull rs6000-bull-bosx rtpc-ibm romp-ibm-aix rx rx-unknown-none rx-linux rx-unknown-linux-gnu +sw_64 sw_64-unknown-none +sw64 sw64-unknown-none s12z s12z-unknown-none s390 s390-ibm-none s390-busybox-linux s390-busybox-linux-gnu -- 2.33.0
