RE: config.sub patch: recognize four-part configuration name for VxWorks OS

2021-01-07 Thread Xin, Peixing
Hi John,

Thanks much for your solution and info. I made some slight changes so that 
things can be correct and more clear. If this one can be merged, appreciated.

Thanks,
Peixing

From: John Ericson 
Sent: Thursday, January 7, 2021 11:36 PM
To: Xin, Peixing mailto:eixing@windriver.com>>; 
config-patches@gnu.org
Subject: Re: config.sub patch: recognize four-part configuration name for 
VxWorks OS


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



0001-Recognize-four-part-configuration-name-for-VxWorks.patch
Description: 0001-Recognize-four-part-configuration-name-for-VxWorks.patch


Re: config.sub patch: recognize four-part configuration name for VxWorks OS

2021-01-07 Thread John Ericson

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 
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 
---
 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-elfaarch64-unknown-elf
 aarch64-unknown-linuxaarch64-unknown-linux-gnu
+aarch64-wrs-vxworksaarch64-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-gnueabiarmv7a-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-eabiarmv7m-unknown-none-eabi
+armv7m-wrs-vxworks-eabihfarmv7m-wrs-vxworks-eabihf
 armv7r		armv7r-unknown-none
 armv8a		armv8a-unknown-none
 armv8b-linux-gnueabiarmv8b-unknown-linux-gnueabi
@@ -290,6 +293,9 @@ i

Re: config.sub patch: recognize four-part configuration name for VxWorks OS

2021-01-07 Thread John Ericson
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