OK here is the my alternative that passes the same tests.

In case any is interested, let me talk about underlying issue that makes this so non-intuitive (more than I initially expected!) is that there is a tension between gnu config thinking

$kernel-$os

and other tools thinking

$os-$extra_info

(Even though the $kernel $os env vars are new from me in ~ last 2 years, config.sub was informally parsing that way for decades.)

This tension basically arose I think when someone reinterpreted linux-gnu not as GNU/linux, but Linux (an OS) + glibc ABI.

The result is config.sub to cope is calling things like `eabihf` or `musl` valid OSs to be filtered later, which is awkward and unintuitive.

Hopefully this can be untangled someday. (I would love to sit down with a bunch of interested parties and come up with e.g. a new JSON convention or something.)

John

On 1/7/21 10:13 AM, John Ericson wrote:

I don't this this patch is right. You are adding another "ad hoc" case, but we should strive not to do that. I will submit an alternative in a moment.

On 1/7/21 12:16 AM, Xin, Peixing wrote:

Hi ,

This patch is to recognize four-part configuration name for VxWorks. For example:

    armv7m-wrs-vxworks-eabihf

    armv7-wrs-vxworks-eabihf

    i686-wrs-vxworks-simlinux

    i686-wrs-vxworks-simwindows

    powerpc-wrs-vxworks-spe

    x86_64-wrs-vxworks-simlinux

    x86_64-wrs-vxworks-simwindows

    It's my check result on Ubuntu 18.04:

    $ make check

    cd testsuite && bash config-guess.sh && rm uname

    PASS: config.guess checks (131 tests)

    cd testsuite && bash config-sub.sh

    PASS: config.sub checks (846 tests)

    PASS: config.sub idempotency checks (783 tests)

    PASS: config.sub canonicalise each config.guess testcase (131 tests)

    * config.sub: Recognize four-part configuration name for VxWorks.

    * testsuite/config-sub.data: Add test cases.

Thanks,

Peixing

>From e5689c76d68d5b52a8aa9355c2e2633b1faf3072 Mon Sep 17 00:00:00 2001
From: Alan Modra <amo...@gmail.com>
Date: Thu, 7 Jan 2021 10:25:28 +1030
Subject: [PATCH] Recognize four-part configuration name for VxWorks.
For example:

  armv7m-wrs-vxworks-eabihf
  armv7-wrs-vxworks-eabihf
  i686-wrs-vxworks-simlinux
  i686-wrs-vxworks-simwindows
  powerpc-wrs-vxworks-spe
  x86_64-wrs-vxworks-simlinux
  x86_64-wrs-vxworks-simwindows

It's our check results (on Ubuntu 18.04 and NixOS 20.09):

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

* config.sub: Recognize four-part configuration name for VxWorks.
* testsuite/config-sub.data: Add test cases.

Co-authored-by: John Ericson <g...@johnericson.me>
---
 config.sub                |  4 +++-
 testsuite/config-sub.data | 14 ++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/config.sub b/config.sub
index b0f8492..caf34fb 100755
--- a/config.sub
+++ b/config.sub
@@ -1684,7 +1684,7 @@ fi
 # Now, validate our (potentially fixed-up) OS.
 case $os in
 	# Sometimes we do "kernel-abi", so those need to count as OSes.
-	musl* | newlib* | uclibc*)
+	musl* | newlib* | uclibc* | simlinux | simwindows | spe)
 		;;
 	# Likewise for "kernel-libc"
 	eabi* | gnueabi*)
@@ -1751,6 +1751,8 @@ case $kernel-$os in
 		;;
 	kfreebsd*-gnu* | kopensolaris*-gnu*)
 		;;
+	vxworks-simlinux | vxworks-simwindows | vxworks-spe)
+		;;
 	nto-qnx*)
 		;;
 	os2-emx)
diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data
index 60cf4fd..1f72e4e 100644
--- a/testsuite/config-sub.data
+++ b/testsuite/config-sub.data
@@ -18,6 +18,7 @@ aarch64-genode					aarch64-unknown-genode
 aarch64-linux					aarch64-unknown-linux-gnu
 aarch64-unknown-elf				aarch64-unknown-elf
 aarch64-unknown-linux				aarch64-unknown-linux-gnu
+aarch64-wrs-vxworks				aarch64-wrs-vxworks
 aarch64_be					aarch64_be-unknown-none
 aarch64_be-bme					aarch64_be-unknown-bme
 aarch64_be-elf					aarch64_be-unknown-elf
@@ -97,6 +98,7 @@ armv7-apple-ios					armv7-apple-ios
 armv7-unknown-netbsdelf7.0			armv7-unknown-netbsdelf7.0
 armv7-unknown-netbsdelf7.0-eabi			armv7-unknown-netbsdelf7.0-eabi
 armv7-unknown-netbsdelf7.0-eabihf		armv7-unknown-netbsdelf7.0-eabihf
+armv7-wrs-vxworks-eabihf			armv7-wrs-vxworks-eabihf
 armv7a						armv7a-unknown-none
 armv7a-linux-gnueabi				armv7a-unknown-linux-gnueabi
 armv7eb-unknown-netbsdelf7.0			armv7eb-unknown-netbsdelf7.0
@@ -104,6 +106,7 @@ armv7eb-unknown-netbsdelf7.0-eabi		armv7eb-unknown-netbsdelf7.0-eabi
 armv7eb-unknown-netbsdelf7.0-eabihf		armv7eb-unknown-netbsdelf7.0-eabihf
 armv7m						armv7m-unknown-none
 armv7m-unknown-none-eabi				armv7m-unknown-none-eabi
+armv7m-wrs-vxworks-eabihf				armv7m-wrs-vxworks-eabihf
 armv7r						armv7r-unknown-none
 armv8a						armv8a-unknown-none
 armv8b-linux-gnueabi				armv8b-unknown-linux-gnueabi
@@ -290,6 +293,9 @@ i686-ericsson-dicos				i686-ericsson-dicos
 i686-haiku					i686-pc-haiku
 i686-kopensolaris5.11-gnu			i686-pc-kopensolaris5.11-gnu
 i686-os2-emx					i686-pc-os2-emx
+i686-wrs-vxworks				i686-wrs-vxworks
+i686-wrs-vxworks-simlinux			i686-wrs-vxworks-simlinux
+i686-wrs-vxworks-simwindows			i686-wrs-vxworks-simwindows
 i786-elf					i786-pc-elf
 i860						i860-unknown-sysv
 i960						i960-unknown-none
@@ -548,8 +554,11 @@ powerpc-elf-lynxos5				powerpc-elf-lynxos5
 powerpc-haiku					powerpc-unknown-haiku
 powerpc-pikeos					powerpc-unknown-elf
 powerpc-sysgo-pikeos				powerpc-sysgo-elf
+powerpc-wrs-vxworks				powerpc-wrs-vxworks
+powerpc-wrs-vxworks-spe			powerpc-wrs-vxworks-spe
 powerpc-xcoff-lynxos178				powerpc-xcoff-lynxos178
 powerpc64					powerpc64-unknown-none
+powerpc64-wrs-vxworks				powerpc64-wrs-vxworks
 powerpc64le					powerpc64le-unknown-none
 powerpcle					powerpcle-unknown-none
 powerpcspe					powerpcspe-unknown-none
@@ -590,11 +599,13 @@ riscv64-company-elf				riscv64-company-elf
 riscv64-elf					riscv64-unknown-elf
 riscv64-hcos					riscv64-unknown-hcos
 riscv64-linux					riscv64-unknown-linux-gnu
+riscv32-wrs-vxworks				riscv32-wrs-vxworks
 riscv32be					riscv32be-unknown-none
 riscv32be-company-elf				riscv32be-company-elf
 riscv32be-company-hcos				riscv32be-company-hcos
 riscv32be-elf					riscv32be-unknown-elf
 riscv32be-linux					riscv32be-unknown-linux-gnu
+riscv64-wrs-vxworks				riscv64-wrs-vxworks
 riscv64be					riscv64be-unknown-none
 riscv64be-company-elf				riscv64be-company-elf
 riscv64be-elf					riscv64be-unknown-elf
@@ -809,6 +820,9 @@ x86_64-sortix					x86_64-pc-sortix
 x86_64-twizzler				x86_64-pc-twizzler
 x86_64-unknown-ptx				x86_64-sequent-ptx
 x86_64-windows					x86_64-pc-windows
+x86_64-wrs-vxworks				x86_64-wrs-vxworks
+x86_64-wrs-vxworks-simlinux			x86_64-wrs-vxworks-simlinux
+x86_64-wrs-vxworks-simwindows			x86_64-wrs-vxworks-simwindows
 xbox						i686-pc-mingw32
 xc16x						xc16x-unknown-none
 xc16x-elf					xc16x-unknown-elf
-- 
2.29.2

Reply via email to