Re: [PATCH] * config.sub: Consolidate OS version checking

2018-05-23 Thread John Ericson

On 05/24/18 01:00, Ben Elliston wrote:

Applied, thanks.  I'm just waiting on the -sequent patch, John, and
then I think I am all caught up.

Cheers, Ben


Ah right. That's why the 6/6 didn't apply in the first place. I didn't 
realize that until now; since the ptx one deletes code, but revised 6/6 
actually technically subsumes it.


> Also, don't you mean "ptx" (not "ipx")?

Indeed

> Can you please add a test case or two to config-sub.data that shows 
the correct behaviour?


Well it depends what we want. Right now

> valid_cpu-valid_os

in the most general case normalizes to

> valid_cpu-unknown-valid_os

with a big exception of valid_cpu being x86 of some sort, in which case 
it normalized to


> valid_cpu-pc-valid_os

This matters because at the bottom "unknown" is defaulted to various 
actual vendors where unambigous, while "pc" isn't. This means we have


> $ ./config.sub x86_64-unknown-ptx
> x86_64-sequent-ptx

but

> $ ./config.sub x86_64-pc-ptx
> x86_64-pc-ptx

and

> $ ./config.sub x86_64-ptx
> x86_64-pc-ptx

There's a few ways forward. The simplest is just to get rid of the x86 
specical case --- with LLVM's influence on configs these days I don't 
think "unknown" would be as surprising as the comment in the code 
complains. Another solution is to across the board "refine" "unknown" 
and "pc" alike to more specific vendors. A third solution would be to 
default to unknown up above, but then refine to pc as a last resort at 
the bottom. The one complication with that is that *-unknown is a valid 
basic_machine pattern, which I think is a bit permissive, but that can 
be worked around with boolean flag variables.


For reference:

5308529936fc0c7bbbc8e04ad31974982481ecd0 commit that added the ptx exception

3836f7b0c4f252e56aa1124a9b235ba62c2a45da commit that added the *-unknown 
pattern


___
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches


[PATCH] * config.sub: Consolidate OS version checking

2018-05-23 Thread John Ericson
This is all that remains of the case at the top, and it can now be
straight-forwardly merged with the rest down at the bottom.
---
 ChangeLog  |   4 ++
 config.sub | 130 +++--
 2 files changed, 61 insertions(+), 73 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 03bb272..7809c9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-05-23  John Ericson  
+
+   * config.sub: Consolidate OS version checking
+
 2018-05-23  John Ericson  
 
* config.sub: Don't force basic_machine based on $os just for
diff --git a/config.sub b/config.sub
index ecc5c5e..9100b8d 100755
--- a/config.sub
+++ b/config.sub
@@ -562,68 +562,6 @@ case $1 in
;;
 esac
 
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-   bluegene*)
-   os=cnk
-   ;;
-   scout)
-   ;;
-   chorusos*)
-   os=chorusos
-   basic_machine=$1
-   ;;
-   chorusrdb)
-   os=chorusrdb
-   basic_machine=$1
-   ;;
-   hiux*)
-   os=hiuxwe2
-   ;;
-   sco6)
-   os=sco5v6
-   ;;
-   sco5)
-   os=sco3.2v5
-   ;;
-   sco4)
-   os=sco3.2v4
-   ;;
-   sco3.2.[4-9]*)
-   os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-   ;;
-   sco3.2v[4-9]*)
-   # Don't forget version if it is 3.2v4 or newer.
-   ;;
-   sco5v6*)
-   # Don't forget version if it is 3.2v4 or newer.
-   ;;
-   sco*)
-   os=sco3.2v2
-   ;;
-   isc)
-   os=isc2.2
-   ;;
-   lynx*178)
-   os=lynxos178
-   ;;
-   lynx*5)
-   os=lynxos5
-   ;;
-   lynx*)
-   os=lynxos
-   ;;
-   ptx*)
-   basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
-   ;;
-   psos*)
-   os=psos
-   ;;
-esac
-
 # Decode aliases for certain CPU-COMPANY combinations.
 case $basic_machine in
# Recognize the basic CPU types without company name.
@@ -1357,6 +1295,9 @@ case $os in
auroraux)
os=auroraux
;;
+   bluegene*)
+   os=cnk
+   ;;
solaris1 | solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
@@ -1373,26 +1314,57 @@ case $os in
es1800*)
os=ose
;;
+   # Some version numbers need modification
+   chorusos*)
+   os=chorusos
+   ;;
+   isc)
+   os=isc2.2
+   ;;
+   sco6)
+   os=sco5v6
+   ;;
+   sco5)
+   os=sco3.2v5
+   ;;
+   sco4)
+   os=sco3.2v4
+   ;;
+   sco3.2.[4-9]*)
+   os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+   ;;
+   sco3.2v[4-9]* | sco5v6*)
+   # Don't forget version if it is 3.2v4 or newer.
+   ;;
+   scout)
+   # Don't match below
+   ;;
+   sco*)
+   os=sco3.2v2
+   ;;
+   psos*)
+   os=psos
+   ;;
# Now accept the basic system types.
# The portable systems comes first.
# Each alternative MUST end in a * to match a version number.
# sysv* is not here because it comes later, after sysvr4.
gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
-| *vms* | sco* | esix* | isc* | aix* | cnk* | sunos | sunos[34]*\
+| *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
 | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
 | sym* | kopensolaris* | plan9* \
 | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
 | aos* | aros* | cloudabi* | sortix* \
 | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
 | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \
-| hiux* | knetbsd* | mirbsd* | netbsd* \
+| knetbsd* | mirbsd* | netbsd* \
 | bitrig* | openbsd* | solidbsd* | libertybsd* \
 | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
 | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
 | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
 | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
-| chorusos* | chorusrdb* | cegcc* | glidix* \
-| cygwin* | msys* | pe* | psos* | moss* | proelf* | rtems* \
+