Good catch. Thank you for the tests. I fixed that, and another thing
that was nagging me about sequent, so I think the next two patches pass
muster fine.
That just leave the deduplicate one, and the dead code it induces. I
like this two-step process of 1. bolster tests and 2. refactor. So if we
can make tests to decide which of the remaining special 1-component
patterns make sense as actual basic-machine rules, and which just makes
sense as 1-component rules, I can then fix up the 3rd patch one final time.
Thanks again for your reviewing and testing,
John
On 08/13/18 00:52, Ben Elliston wrote:
On Mon, Aug 13, 2018 at 12:12:56AM -0400, John Ericson wrote:
Hmm bummer. Sorry about that. Here's them all again, with that and
another hopefully "non controversial" one moved to the front.
0001 and 0002 have been applied.
0003 fails to recognise decstation-3100, whereas it did before.
Ben
>From 8881955310c5f58a066d846a0d1890eb4b35e409 Mon Sep 17 00:00:00 2001
Message-Id:
<8881955310c5f58a066d846a0d1890eb4b35e409.1534177617.git.John.Ericson@Obsidian.Systems>
From: John Ericson <John.Ericson@Obsidian.Systems>
Date: Mon, 30 Jul 2018 13:08:12 -0400
Subject: [PATCH 1/3] * config.sub: Move some erroneous `foo-*` to be
1-comp aliases
To: config-patches@gnu.org
---
ChangeLog | 30 +++++++++++++++++++++
config.sub | 79 +++++++++++++++++++++++++++++++-----------------------
2 files changed, 76 insertions(+), 33 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 366ffff..125ca35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2018-08-08 John Ericson <john.ericson@obsidian.systems>
+
+ * config.sub: Move some erroneous `foo-*` to be 1-comp aliases
+
+ The `foo-*` versions were introduced in
+ 5347fada50a3a3e689c2654515145457af92965e
+ 1bf0fb0812846ace88f93937e90162e2835c6b11
+ ab3a1065d559246c2c0422513e04369f49639c62, and then right after
+ augmented with the `foo` versions in
+ 1d62957bb23205508ea3eb7c790e431646fad6ae right after.
+
+ I think that commit didn't go far enough, in in that the original
+ `foo-*` verions should have also been removed:
+
+ - "foo" is closer to a company name than arch name, so they are
+ in no way a proper 2-component basic name. That would mean
+ there's one companny name in the original `basic_machine`
+ that's ignored, and the other that is defaulted with some arch.
+ That seems arbitrary.
+
+ - "foo-*" being radically normalized, but "foo" not being, is
+ just inconsistent.
+
+ In addition, I also move the rest to be single component aliases
+ as they are company names or product lines.
+
+ This is a breaking change, but not one I'd expect to matter since
+ all these machines are ancient and the tests still pass without
+ modification.
+
2018-08-13 Ben Elliston <b...@gnu.org>
* testsuite/config-sub.data: Add legacy test cases for cydra,
diff --git a/config.sub b/config.sub
index c19e671..be1d6cc 100755
--- a/config.sub
+++ b/config.sub
@@ -149,29 +149,39 @@ case $1 in
esac
;;
*-*)
- # Second component is usually, but not always the OS
- case $field2 in
- # Prevent following clause from handling this valid os
- sun*os*)
- basic_machine=$field1
- os=$field2
- ;;
- # Manufacturers
- dec* | mips* | sequent* | encore* | pc532* | sgi* |
sony* \
- | att* | 7300* | 3300* | delta* | motorola* | sun[234]*
\
- | unicom* | ibm* | next | hp | isi* | apollo | altos* \
- | convergent* | ncr* | news | 32* | 3600* | 3100* |
hitachi* \
- | c[123]* | convex* | sun | crds | omron* | dg | ultra
| tti* \
- | harris | dolphin | highlevel | gould | cbm | ns |
masscomp \
- | apple | axis | knuth | cray | microblaze* \
- | sim | cisco | oki | wec | wrs | winbond)
- basic_machine=$field1-$field2
+ # A lone config we happen to match not fitting any patern
+ case $field1-$field2 in
+ decstation-3100)
+ basic_machine=mips-dec
os=
;;
- *)
- basic_machine=$field1
- os=$field2
- ;;
+ *-*)
+ # Second component is usually, but not always
the OS
+ case $field2 in
+ # Prevent following clause from
handling this valid os
+ sun*os*)
+ basic_machine=$field1
+ os=$field2
+ ;;
+ # Manufacturers
+ dec* | mips* | sequent* | encore* |
pc533* | sgi* | sony* \
+ | att* | 7300* | 3300* | delta* |
motorola* | sun[234]* \
+ | unicom* | ibm* | next | hp | isi* |
apollo | altos* \
+ | convergent* | ncr* | news | 32* |
3600* | 3100* \
+ | hitachi* | c[123]* | convex* | sun |
crds | omron* | dg \
+ | ultra | tti* | harris | dolphin |
highlevel | gould \
+ | cbm | ns | masscomp | apple | axis |
knuth | cray \
+ | microblaze* | sim | cisco \
+ | oki | wec | wrs | winbond)
+ basic_machine=$field1-$field2
+ os=
+ ;;
+ *)
+ basic_machine=$field1
+ os=$field2
+ ;;
+ esac
+ ;;
esac
;;
*)
@@ -206,6 +216,10 @@ case $1 in
basic_machine=580-amdahl
os=sysv
;;
+ amiga)
+ basic_machine=m68k-unknown
+ os=
+ ;;
amigaos | amigados)
basic_machine=m68k-unknown
os=amigaos
@@ -270,6 +284,14 @@ case $1 in
basic_machine=m68k-crds
os=
;;
+ da30)
+ basic_machine=m68k-da30
+ os=
+ ;;
+ decstation | pmax | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ os=
+ ;;
delta88)
basic_machine=m88k-motorola
os=sysv3
@@ -314,6 +336,9 @@ case $1 in
basic_machine=m88k-harris
os=sysv3
;;
+ hp300)
+ basic_machine=m68k-hp
+ ;;
hp300bsd)
basic_machine=m68k-hp
os=bsd
@@ -904,9 +929,6 @@ case $basic_machine in
amd64-*)
basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
blackfin-*)
basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=linux
@@ -942,12 +964,6 @@ case $basic_machine in
basic_machine=crx-unknown
os=${os:-elf}
;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 |
decstatn)
- basic_machine=mips-dec
- ;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=tops10
@@ -993,9 +1009,6 @@ case $basic_machine in
basic_machine=hppa1.1-hitachi
os=hiuxwe2
;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
--
2.17.1
>From 0f4e77348ee092f986d39954c76c27b8362a4737 Mon Sep 17 00:00:00 2001
Message-Id:
<0f4e77348ee092f986d39954c76c27b8362a4737.1534177617.git.John.Ericson@Obsidian.Systems>
In-Reply-To:
<8881955310c5f58a066d846a0d1890eb4b35e409.1534177617.git.John.Ericson@Obsidian.Systems>
References:
<8881955310c5f58a066d846a0d1890eb4b35e409.1534177617.git.John.Ericson@Obsidian.Systems>
From: John Ericson <John.Ericson@Obsidian.Systems>
Date: Mon, 13 Aug 2018 12:14:05 -0400
Subject: [PATCH 2/3] * config.sub (sequent): Make 1 component alias *
testsuite/config-sub.data: Make `sequent-ptx` test just `sequent`.
To: config-patches@gnu.org
---
ChangeLog | 13 +++++++++++++
config.sub | 7 ++++---
testsuite/config-sub.data | 2 +-
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 125ca35..3244284 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2018-07-23 John Ericson <john.ericson@obsidian.systems>
+
+ * config.sub (sequent): Make 1 component alias
+ * testsuite/config-sub.data: Make `sequent-ptx` test just `sequent`.
+
+ This test was just recently added in
+ 3a2a927f547ee478147008c3fda2adb8a2b2ebc4. My thinking is that since
+ we explictly desugar multiple configs matching machines made by
+ Sequent, we maybe shouldn't really privilage one over the others at
+ all, but at the very least the short hand should just be allowed in
+ the more free-form single component case, not as a general
+ `basic_machine` rule.
+
2018-08-08 John Ericson <john.ericson@obsidian.systems>
* config.sub: Move some erroneous `foo-*` to be 1-comp aliases
diff --git a/config.sub b/config.sub
index be1d6cc..6e8fa65 100755
--- a/config.sub
+++ b/config.sub
@@ -507,6 +507,10 @@ case $1 in
basic_machine=mips-sei
os=seiux
;;
+ sequent)
+ basic_machine=i386-sequent
+ os=
+ ;;
sps7)
basic_machine=m68k-bull
os=sysv2
@@ -1234,9 +1238,6 @@ case $basic_machine in
basic_machine=mipsisa32-sde
os=${os:-elf}
;;
- sequent)
- basic_machine=i386-sequent
- ;;
sh5el)
basic_machine=sh5le-unknown
;;
diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data
index 9608d2a..2c6771a 100644
--- a/testsuite/config-sub.data
+++ b/testsuite/config-sub.data
@@ -452,7 +452,7 @@ s390-ibm-zvmoe
s390-ibm-zvmoe
score-elf score-unknown-elf
score score-unknown-elf
sde-elf mipsisa32-sde-elf
-sequent-ptx i386-sequent-ptx
+sequent i386-sequent-ptx
sh1-elf sh1-unknown-elf
sh1le-elf sh1le-unknown-elf
sh1 sh1-unknown-none
--
2.17.1
>From 026e2c5b9251e7d70f339bed10e07be5ca89c665 Mon Sep 17 00:00:00 2001
Message-Id:
<026e2c5b9251e7d70f339bed10e07be5ca89c665.1534177617.git.John.Ericson@Obsidian.Systems>
In-Reply-To:
<0f4e77348ee092f986d39954c76c27b8362a4737.1534177617.git.John.Ericson@Obsidian.Systems>
References:
<8881955310c5f58a066d846a0d1890eb4b35e409.1534177617.git.John.Ericson@Obsidian.Systems>
<0f4e77348ee092f986d39954c76c27b8362a4737.1534177617.git.John.Ericson@Obsidian.Systems>
From: John Ericson <John.Ericson@Obsidian.Systems>
Date: Fri, 22 Jun 2018 17:40:14 -0400
Subject: [PATCH 3/3] * config.sub: Deduplicate `basic_machine` by filling
in a stub vendor.
To: config-patches@gnu.org
---
ChangeLog | 24 ++++++
config.sub | 212 ++++++++++++++---------------------------------------
2 files changed, 81 insertions(+), 155 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3244284..8af5e51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2018-07-23 John Ericson <john.ericson@obsidian.systems>
+
+ * config.sub: Deduplicate `basic_machine` by filling in a stub vendor.
+
+ Instead of having both `foo` and `foo-*` as redundant patterns, we
+ always make sure basic_machine is initialized in the form `*-*` by
+ adding a trailing `-unknown` where needed.
+
+ There was one complication to doing this that should be noted. For
+ x86, the default is `-pc` instead of `-unknown`. That means we
+ can't just always append 1-component `basic_machine`s with
+ `-unknown` and assume 2-component everywhere. Furthermore, an
+ explicitly passed `*-unknown` for x86 is not normalized by that
+ rule but instead left as-is. That means we cannot just append and
+ also conditionally replace `-unknown` with `-pc` as a final step,
+ either.
+
+ The solution is to continue duplicating the rules which would
+ output a `(i386|x86_64)-pc` so we can ensure the special case is
+ maintained, while defaulting to `-unknown` otherwise so the `*-*`
+ rules are sufficient. This isn't ideal, but at least most of the
+ `basic_machine` rules aren't implicated and can still be
+ deduplicated.
+
2018-07-23 John Ericson <john.ericson@obsidian.systems>
* config.sub (sequent): Make 1 component alias
diff --git a/config.sub b/config.sub
index 6e8fa65..49acd39 100755
--- a/config.sub
+++ b/config.sub
@@ -639,15 +639,45 @@ case $1 in
;;
esac
+case $basic_machine in
+ *-*)
+ ;;
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # These rules are duplicated from below for sake of the special case
above;
+ # i.e. things that normalized to x86 arches should also default to "pc"
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ x64 | amd64)
+ basic_machine=x86_64-pc
+ ;;
+ # These are improper single component basic machines, as they should
+ # drop the vendor for just the CPU instead of the CPU for just the
+ # vendor as they in fact do. But they are tested to occur as part of
+ # multi-component configs, so we can't move them to the single
+ # component alises whitelist above.
+ sde)
+ basic_machine=mipsisa32-sde
+ os=${os:-elf}
+ ;;
+ *)
+ basic_machine=$basic_machine-unknown
+esac
+
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Here we handle the default manufacturer of certain CPU types. It is
in
# some cases the only manufacturer, in others, it is the most popular.
- craynv)
+ craynv-unknown)
basic_machine=craynv-cray
os=${os:-unicosmp}
;;
- fx80)
+ fx80-unknown)
basic_machine=fx80-alliant
;;
w89k)
@@ -659,31 +689,31 @@ case $basic_machine in
op60c)
basic_machine=hppa1.1-oki
;;
- romp)
+ romp-unknown)
basic_machine=romp-ibm
;;
- mmix)
+ mmix-unknown)
basic_machine=mmix-knuth
;;
- rs6000)
+ rs6000-unknown)
basic_machine=rs6000-ibm
;;
- vax)
+ vax-unknown)
basic_machine=vax-dec
;;
- pdp11)
+ pdp11-unknown)
basic_machine=pdp11-dec
;;
- we32k)
+ we32k-unknown)
basic_machine=we32k-att
;;
- cydra)
+ cydra-unknown)
basic_machine=cydra-cydrome
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
- orion)
+ orion-unknown)
basic_machine=orion-highlevel
;;
orion105)
@@ -695,131 +725,10 @@ case $basic_machine in
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
- xps | xps100)
+ xps-unknown | xps100-unknown)
basic_machine=xps100-honeywell
;;
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | abacus \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] |
alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m |
armv[78][arm] \
- | avr | avr32 \
- | asmjs \
- | ba \
- | be32 | be64 \
- | bfin \
- | c4x | c8051 | clipper | csky \
- | d10v | d30v | dlx | dsp16xx \
- | e2k | epiphany \
- | fido | fr30 | frv | ft32 \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia16 | ia64 \
- | ip2k | iq2000 \
- | k1om \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa32r6 | mipsisa32r6el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64r6 | mipsisa64r6el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nfp \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 | or1k | or1knd | or32 \
- | pdp10 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pru \
- | pyramid \
- | riscv | riscv32 | riscv64 \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb |
shbe | shle | sh[1234]le | sh[23]ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet |
sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | visium \
- | wasm32 \
- | x86 | xc16x | xstormy16 | xgate | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- leon|leon[3-9])
- basic_machine=sparc-$basic_machine
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
- ;;
- m9s12z | m68hcs12z | hcs12z | s12z)
- basic_machine=s12z-unknown
- ;;
- m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
- basic_machine=s12z-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
- ;;
- xscaleeb)
- basic_machine=armeb-unknown
- ;;
-
- xscaleel)
- basic_machine=armel-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
# Recognize the basic CPU types with company name.
1750a-* | 580-* \
| a29k-* \
@@ -915,10 +824,6 @@ case $basic_machine in
| ymp-* \
| z8k-* | z80-*)
;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
@@ -954,14 +859,17 @@ case $basic_machine in
basic_machine=c90-cray
os=${os:-unicos}
;;
- cr16 | cr16-*)
+ cr16-*)
basic_machine=cr16-unknown
os=${os:-elf}
;;
- crisv32 | crisv32-* | etraxfs*)
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
- cris | cris-* | etrax*)
+ cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
@@ -980,7 +888,7 @@ case $basic_machine in
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
- dpx20 | dpx20-*)
+ dpx20-*)
basic_machine=rs6000-bull
os=${os:-bosx}
;;
@@ -1079,6 +987,10 @@ case $basic_machine in
basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=linux
;;
+ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+ basic_machine=s12z-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ os=${os:-none}
+ ;;
microblaze*)
basic_machine=microblaze-xilinx
;;
@@ -1154,12 +1066,9 @@ case $basic_machine in
pbb)
basic_machine=m68k-tti
;;
- pc532 | pc532-*)
+ pc532-*)
basic_machine=ns32k-pc532
;;
- pc98)
- basic_machine=i386-pc
- ;;
pc98-*)
basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
@@ -1234,12 +1143,8 @@ case $basic_machine in
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
- sde)
- basic_machine=mipsisa32-sde
- os=${os:-elf}
- ;;
- sh5el)
- basic_machine=sh5le-unknown
+ sh5e[lb]-*)
+ basic_machine=`echo "$basic_machine" | sed
's/^\(sh.\)e\(.\)-/\1\2e-/'`
;;
sh5el-*)
basic_machine=sh5le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
@@ -1255,9 +1160,6 @@ case $basic_machine in
basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
tile*-*)
- ;;
- tile*)
- basic_machine=$basic_machine-unknown
os=${os:-linux-gnu}
;;
tx39)
@@ -1280,8 +1182,8 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=proelf
;;
- x64)
- basic_machine=x86_64-pc
+ x64-*)
+ basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
--
2.17.1
_______________________________________________
config-patches mailing list
config-patches@gnu.org
https://lists.gnu.org/mailman/listinfo/config-patches