Re: [PATCH] * config.sub: Deduplicate `basic_machine` by always allowing the vendor
On 08/20/18 02:54, Ben Elliston wrote: I am still seeing Shellcheck problems and testsuite failures with the 2nd _and_ 3rd patches applied. Please don't break the testsuite, even temporarily. Weird. I do see those problems not on my branch with `make shellcheck check-sub`. Here's fresh patches in case I didn't `git format-patch` the most recent version. Cheers, John >From 6afaff4b3a5218c781b8f8d892276f11f02f51eb Mon Sep 17 00:00:00 2001 Message-Id: <6afaff4b3a5218c781b8f8d892276f11f02f51eb.1534748527.git.John.Ericson@Obsidian.Systems> From: John Ericson Date: Tue, 14 Aug 2018 13:35:59 -0400 Subject: [PATCH 1/2] * config.sub: Move the big patterns to the bottom To: config-patches@gnu.org --- ChangeLog | 8 + config.sub | 422 +++-- 2 files changed, 220 insertions(+), 210 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4fb5346..c654bb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2018-08-20 John Ericson + + * config.sub: Move the big patterns to the bottom + + This is done in preparation for deduplication. It causes shellcheck + to see more overlapping patterns, and breaks some tests. I need + somebody else to resolve the fallout and then I can procede. + 2018-08-20 John Ericson * testsuite/config-sub.data: Add legacy test cases. diff --git a/config.sub b/config.sub index 6e8fa65..7df77e0 100755 --- a/config.sub +++ b/config.sub @@ -699,222 +699,13 @@ case $basic_machine in 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 -
Re: [PATCH] * config.sub: Deduplicate `basic_machine` by always allowing the vendor
Here are the last 3 patches, revised Yes the * is probably just a cut and paste artifact. I suppose it is harmless and could hint to the human what the expected behavior, but for simplicity I just removed it. The crx- * test I deleted from the first patch too. That leaves the 1st patch working properly. The 2nd patch is exactly as before. It still breaks things, but that is intentional, with the 3rd patch fixing the breakage and the crx test instead. I could have combined them, but I suspect they'll be easier to read separately so I kept them separate. If you want to apply them together that is fine with me. Thanks, John On 08/20/18 00:34, Ben Elliston wrote: On Tue, Aug 14, 2018 at 01:53:37PM -0400, John Ericson wrote: Message-Id: <7aa195016503d03125cdcbaf0a53788322ea7dc6.1534269204.git.John.Ericson@Obsidian.Systems> From: John Ericson Date: Tue, 14 Aug 2018 13:25:58 -0400 Subject: [PATCH 1/2] * testsuite/config-sub.data: Add legacy test cases To: config-patches@gnu.org This is a bit weird: @@ -140,8 +142,13 @@ dec3100 mips-dec-ultrix4.2 decstationmips-dec-ultrix4.2 decstation-3100 mips-dec-ultrix4.2 decstatn mips-dec-ultrix4.2 +decsystem10* pdp10-dec-tops10 +dec10* pdp10-dec-tops10 +decsystem20* pdp10-dec-tops20 +dec20* pdp10-dec-tops20 dicos i686-pc-dicos Why are you adding test cases with asterisks in them? Looks like too much copying and pasting? Also, the revised testsuite does not pass: Invalid configuration `crx-unknown-elf': machine `crx-unknown' not recognized FAIL: crx-unknown-elf -> , but crx-unknown-elf should map to itself Please remove the failing tests until you submit a patch that fixes the problem (and the test case can accompany that patch). Thanks, Ben >From 8186ffa46fa80dc9bdfc9824225bdeb99bfa33b2 Mon Sep 17 00:00:00 2001 Message-Id: <8186ffa46fa80dc9bdfc9824225bdeb99bfa33b2.1534744813.git.John.Ericson@Obsidian.Systems> From: John Ericson Date: Tue, 14 Aug 2018 13:25:58 -0400 Subject: [PATCH 1/3] * testsuite/config-sub.data: Add legacy test cases To: config-patches@gnu.org --- ChangeLog | 4 testsuite/config-sub.data | 19 +++ 2 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index b06386f..0703309 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2018-08-14 John Ericson + + * testsuite/config-sub.data: Add legacy test cases + 2018-08-14 John Ericson * config.sub (sequent): Make this a one-component alias. diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data index 2c6771a..266175d 100644 --- a/testsuite/config-sub.data +++ b/testsuite/config-sub.data @@ -122,6 +122,7 @@ c6x-unknown-coff tic6x-unknown-coff c6x-unknown-elftic6x-unknown-elf c8051 c8051-unknown-elf c8051-elf c8051-unknown-elf +c90c90-cray-unicos cegcc arm-unknown-cegcc clipperclipper-unknown-none clipper-clix clipper-intergraph-clix @@ -140,8 +141,13 @@ dec3100 mips-dec-ultrix4.2 decstation mips-dec-ultrix4.2 decstation-3100mips-dec-ultrix4.2 decstatn mips-dec-ultrix4.2 +decsystem10pdp10-dec-tops10 +dec10 pdp10-dec-tops10 +decsystem20pdp10-dec-tops20 +dec20 pdp10-dec-tops20 dicos i686-pc-dicos djgpp i586-pc-msdosdjgpp +dpx2xxxm68k-bull-sysv3 dlxdlx-unknown-none dsp16xxdsp16xx-unknown-none e2ke2k-unknown-none @@ -151,6 +157,10 @@ e500v2-elf powerpc-unknown-elfspe e500v2-vxworksae powerpc-wrs-vxworksaespe e500v2-wrs-linux powerpc-wrs-linux-gnuspe e500v2-wrs-vxworks powerpc-wrs-vxworksspe +elxsi elxsi-elxsi-bsd +encore ns32k-encore-bsd +umax
Re: [PATCH] * config.sub: Deduplicate `basic_machine` by always allowing the vendor
On Tue, Aug 14, 2018 at 01:53:37PM -0400, John Ericson wrote: > Message-Id: > <7aa195016503d03125cdcbaf0a53788322ea7dc6.1534269204.git.John.Ericson@Obsidian.Systems> > From: John Ericson > Date: Tue, 14 Aug 2018 13:25:58 -0400 > Subject: [PATCH 1/2] * testsuite/config-sub.data: Add legacy test cases > To: config-patches@gnu.org This is a bit weird: > @@ -140,8 +142,13 @@ dec3100 > mips-dec-ultrix4.2 > decstation mips-dec-ultrix4.2 > decstation-3100 mips-dec-ultrix4.2 > decstatn mips-dec-ultrix4.2 > +decsystem10* pdp10-dec-tops10 > +dec10* pdp10-dec-tops10 > +decsystem20* pdp10-dec-tops20 > +dec20* pdp10-dec-tops20 > dicosi686-pc-dicos Why are you adding test cases with asterisks in them? Looks like too much copying and pasting? Also, the revised testsuite does not pass: Invalid configuration `crx-unknown-elf': machine `crx-unknown' not recognized FAIL: crx-unknown-elf -> , but crx-unknown-elf should map to itself Please remove the failing tests until you submit a patch that fixes the problem (and the test case can accompany that patch). Thanks, Ben signature.asc Description: PGP signature ___ config-patches mailing list config-patches@gnu.org https://lists.gnu.org/mailman/listinfo/config-patches
Re: [PATCH] * config.sub: Deduplicate `basic_machine` by always allowing the vendor
On 08/14/18 13:53, John Ericson wrote: I think I need you to resolve these problems as you see fit. Here's a tentative resolution of those issues. >From f8b614809cfabd6f98cfc02b7cf90bf2f68d30cf Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: <7aa195016503d03125cdcbaf0a53788322ea7dc6.1534272803.git.John.Ericson@Obsidian.Systems> From: John Ericson Date: Tue, 14 Aug 2018 14:52:46 -0400 Subject: [PATCH 3/3] Tenative fixes to issues arriving from previous commit To: config-patches@gnu.org --- config.sub| 22 ++ testsuite/config-sub.data | 13 +++-- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/config.sub b/config.sub index 7df77e0..562f38f 100755 --- a/config.sub +++ b/config.sub @@ -692,6 +692,9 @@ case $basic_machine in mac | mpw | mac-mpw) basic_machine=m68k-apple ;; + microblaze | microblazeel) + basic_machine=$basic_machine-xilinx + ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; @@ -706,10 +709,6 @@ case $basic_machine in basic_machine=$basic_machine-pc ;; - # 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) @@ -755,6 +754,9 @@ case $basic_machine in cris | cris-* | etrax*) basic_machine=cris-axis ;; + crx-*) + os=${os:-elf} + ;; crx) basic_machine=crx-unknown os=${os:-elf} @@ -870,9 +872,6 @@ case $basic_machine in basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=linux ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; miniframe) basic_machine=m68000-convergent ;; @@ -1063,9 +1062,8 @@ case $basic_machine in vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; - w65*) + w65) basic_machine=w65-wdc - os=none ;; w89k-*) basic_machine=hppa1.1-winbond @@ -1206,7 +1204,7 @@ case $basic_machine in | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | maxq | mb | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -1254,7 +1252,7 @@ case $basic_machine in | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ - | x86 | xc16x | xstormy16 | xgate | xtensa \ + | x86 | xc16x | xstormy16 | xgate | xtensa* \ | z8k | z80) basic_machine=$basic_machine-unknown ;; @@ -1270,7 +1268,7 @@ case $basic_machine in leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70) ;; m9s12z | m68hcs12z | hcs12z | s12z) basic_machine=s12z-unknown diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data index 8323a6b..5603920 100644 --- a/testsuite/config-sub.data +++ b/testsuite/config-sub.data @@ -285,12 +285,13 @@ mep-elf mep-unknown-elf mepmep-unknown-elf metag-linuxmetag-unknown-linux-gnu metag metag-unknown-none -microblazeel-elf microblazeel-unknown-elf -microblaze-elf microblaze-unknown-elf -microblazeel-linux microblazeel-unknown-linux-gnu -microblazeel microblazeel-unknown-none -microblaze-linux microblaze-unknown-linux-gnu -microblaze microblaze-unknown-none +microblazeel-elf microblazeel-xilinx-elf +microblazeel-foobar-elfmicroblazeel-foobar-elf +microblaze-elf microblaze-xilinx-elf +microblazeel-linux microblazeel-xilinx-linux-gnu +microblazeel microblazeel-xilinx-none +microblaze-linux microblaze-xilinx-linux-gnu
Re: [PATCH] * config.sub: Deduplicate `basic_machine` by always allowing the vendor
On Mon, Aug 13, 2018 at 08:52:12PM -0400, John Ericson wrote: > Heh, well if only we had arrays of arrays, I'd put the > patterns->normalization in as data, and then just source it to build > the test cases. That wouldn't be much of a testsuite, now, would it? ;-) Ben signature.asc Description: PGP signature ___ config-patches mailing list config-patches@gnu.org https://lists.gnu.org/mailman/listinfo/config-patches
Re: [PATCH] * config.sub: Deduplicate `basic_machine` by always allowing the vendor
Oops, I just saw #3 was slightly bigger because I accidentally reverted a previous patch of mine. Here's it all pulled out. On 08/13/18 20:15, Ben Elliston wrote: I have applied patches 0001 and 0002, thanks. 0003 is quite large and I want to spend some time examining it more closely. Sound good. I might pull out more single component things, more aggressively now too as the canonicalization tests can keep us safer. You know, a bit of awk or Perl would allow us to write out a list of accepted patterns from which we could make the testsuite exhaustive. Heh, well if only we had arrays of arrays, I'd put the patterns->normalization in as data, and then just source it to build the test cases. But yes, some automation would be nice. I think that would be easier after the refactors so I'll get cranking pulling out those single-component ones. John >From 22015b2837e53a9f310a0973adfca112884bcfe1 Mon Sep 17 00:00:00 2001 Message-Id: <22015b2837e53a9f310a0973adfca112884bcfe1.1534206979.git.John.Ericson@Obsidian.Systems> From: John Ericson Date: Fri, 22 Jun 2018 17:40:14 -0400 Subject: [PATCH] * config.sub: Deduplicate `basic_machine` by filling in a stub vendor. To: config-patches@gnu.org --- ChangeLog | 24 ++ config.sub | 212 ++--- 2 files changed, 78 insertions(+), 158 deletions(-) diff --git a/ChangeLog b/ChangeLog index b06386f..14dce34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2018-08-14 John Ericson + + * 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-08-14 John Ericson * config.sub (sequent): Make this a one-component alias. diff --git a/config.sub b/config.sub index 6e8fa65..8264524 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
Re: [PATCH] * config.sub: Deduplicate `basic_machine` by always allowing the vendor
On Mon, Aug 13, 2018 at 12:31:29PM -0400, John Ericson wrote: > 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. I have applied patches 0001 and 0002, thanks. 0003 is quite large and I want to spend some time examining it more closely. You know, a bit of awk or Perl would allow us to write out a list of accepted patterns from which we could make the testsuite exhaustive. Cheers, Ben signature.asc Description: PGP signature ___ config-patches mailing list config-patches@gnu.org https://lists.gnu.org/mailman/listinfo/config-patches
Re: [PATCH] * config.sub: Deduplicate `basic_machine` by always allowing the vendor
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 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 366..125ca35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +2018-08-08 John Ericson + + * 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 * 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*) +
Re: [PATCH] * config.sub: Deduplicate `basic_machine` by always allowing the vendor
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 signature.asc Description: PGP signature ___ config-patches mailing list config-patches@gnu.org https://lists.gnu.org/mailman/listinfo/config-patches
Re: [PATCH] * config.sub: Deduplicate `basic_machine` by always allowing the vendor
Hmm bummer. Sorry about that. Here's them all again, with that and another hopefully "non controversial" one moved to the front. Cheers, John On 08/12/18 21:34, Ben Elliston wrote: On Sun, Aug 12, 2018 at 09:01:37PM -0400, John Ericson wrote: I'm rebasing and retesting them all now, but you could just skip that and apply the next one (on craynv), which is simple and makes config.sub strictly more accepting, in the meantime. No, that doesn't apply cleanly either. Ben From 22af8b94e9b892db3a82bfd1fd9004ee846dfc7a Mon Sep 17 00:00:00 2001 Message-Id: <22af8b94e9b892db3a82bfd1fd9004ee846dfc7a.1534130227.git.John.Ericson@Obsidian.Systems> From: John Ericson Date: Mon, 30 Jul 2018 13:00:25 -0400 Subject: [PATCH 1/5] * config.sub: Move back craynv as a `basic_machine` pattern * testsuite/config-sub.data: Add test for craynv To: config-patches@gnu.org --- ChangeLog | 10 ++ config.sub| 8 testsuite/config-sub.data | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bce9d4b..770d4b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2018-08-08 John Ericson + + * config.sub: Move back craynv as a `basic_machine` pattern + * testsuite/config-sub.data: Add test for craynv + + This is in fact a valid archecture, even though it also contains + "cray" the company name, and thus may look like some shorthand. + Adding a test to make sure we accept it (tested via the + ideompotency check). + 2018-08-13 Ben Elliston * testsuite/config-sub.data: Add some legacy test cases. diff --git a/config.sub b/config.sub index c1b397a..e4226de 100755 --- a/config.sub +++ b/config.sub @@ -238,10 +238,6 @@ case $1 in basic_machine=j90-cray os=unicos ;; - craynv) - basic_machine=craynv-cray - os=unicosmp - ;; delta88) basic_machine=m88k-motorola os=sysv3 @@ -566,6 +562,10 @@ esac 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) + basic_machine=craynv-cray + os=${os:-unicosmp} + ;; w89k) basic_machine=hppa1.1-winbond ;; diff --git a/testsuite/config-sub.data b/testsuite/config-sub.data index aca8634..81472be 100644 --- a/testsuite/config-sub.data +++ b/testsuite/config-sub.data @@ -130,6 +130,7 @@ cr16-random-elf cr16-unknown-elf crds m68k-crds-unos cris-linux cris-axis-linux-gnu crisv32-linux crisv32-axis-linux-gnu +craynv craynv-cray-unicosmp csky-linux csky-unknown-linux-gnu d10v d10v-unknown-none d30v d30v-unknown-none -- 2.17.1 From cc5dbc1a535d69c87ba70822a1442d3ebb99d6fc Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: <22af8b94e9b892db3a82bfd1fd9004ee846dfc7a.1534130227.git.John.Ericson@Obsidian.Systems> References: <22af8b94e9b892db3a82bfd1fd9004ee846dfc7a.1534130227.git.John.Ericson@Obsidian.Systems> From: John Ericson Date: Thu, 9 Aug 2018 02:31:04 -0400 Subject: [PATCH 2/5] * config.sub: Combine match arms To: config-patches@gnu.org --- ChangeLog | 6 ++ config.sub | 16 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 770d4b1..71fd90a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-08-08 John Ericson + + * config.sub: Combine match arms + + These need no special handling. + 2018-08-08 John Ericson * config.sub: Move back craynv as a `basic_machine` pattern diff --git a/config.sub b/config.sub index e4226de..5795377 100755 --- a/config.sub +++ b/config.sub @@ -643,6 +643,7 @@ case $basic_machine in | 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 \ @@ -691,7 +692,7 @@ case $basic_machine in | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ - | x86 | xc16x | xstormy16 | xtensa \ + | x86 | xc16x | xstormy16 | xgate | xtensa \ | z8k | z80)
Re: [PATCH] * config.sub: Deduplicate `basic_machine` by always allowing the vendor
OK, now that the idempotency checks are in, here is a new version of the deduplication. I broke it up more, and added often-extensive notes on each step in the ChangeLog. All of them past the testsuite, but the last one (alone) make some basic_machine patterns not in the form `vendor-machine` as dead code. We should triage those cases before that patch is applied. Cheers, John From 630d61c8e93b2ecbf88534c3dfce68668426d410 Mon Sep 17 00:00:00 2001 Message-Id: <630d61c8e93b2ecbf88534c3dfce68668426d410.1533797562.git.John.Ericson@Obsidian.Systems> From: John Ericson Date: Mon, 30 Jul 2018 10:36:00 -0400 Subject: [PATCH 1/6] * config.sub: Move manufacture-defaultint patterns to the top To: config-patches@gnu.org --- ChangeLog | 10 ++ config.sub | 103 +++-- 2 files changed, 62 insertions(+), 51 deletions(-) diff --git a/ChangeLog b/ChangeLog index f79ad5f..e6bad15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2018-08-08 John Ericson + + * config.sub: Move manufacture-defaultint patterns to the top + + Eventually the glob patterns should always go last. That way + previous patterns can refine them by being more specific. These + manufacture-defaulting patterns right now are in the form `foo`, + but would eventually be in the form `foo-unknown` so as to default + the vendor without overriding it more completely. + 2018-08-08 John Ericson * config.sub: Eliminate some dead code for SH targets. diff --git a/config.sub b/config.sub index 97d38aa..3a7b60c 100755 --- a/config.sub +++ b/config.sub @@ -564,6 +564,57 @@ 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. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + cydra) + basic_machine=cydra-cydrome + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ @@ -718,7 +769,7 @@ case $basic_machine in | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ - | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ + | i370-* | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ @@ -956,9 +1007,6 @@ case $basic_machine in hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; i*86v32) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=sysv32 @@ -1218,9 +1266,6 @@ case $basic_machine in x64) basic_machine=x86_64-pc ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; @@ -1228,50 +1273,6 @@ case $basic_machine in basic_machine=none-none ;; -# 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. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth -
[PATCH] * config.sub: Deduplicate `basic_machine` by always allowing the 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 were two complications to doing this however, but they were worked around: The first is that for some reason `basic_machine`s in the form `*-unknown` are always accepted, dating back to 3836f7b0c4f252e56aa1124a9b235ba62c2a45da. It is important that we don't allow the inferred `-unknown` to allow nonsense one-component basic machines to pass for the first time. The second is that for x86, the default is `-pc` instead of `-unknown`. That said, an explicitly passed `-unknown` is not normalized by that rule and left as-is. Two tests were nevertheless changed but: -vsta i386-unknown-vsta +vsta i386-pc-vsta Seems like fixing a blatant inconsistency, while: -x86_64-ptx x86_64-pc-ptx +x86_64-ptx x86_64-sequent-ptx Fixes a small regression I previously introduced. The solution in both cases is to distinguish explicit user given from inferred/defaulted `-unknown`s, and use that to implement the existing behavior. For this purpose, the `vendor_inferred` variable was added. For what it's worth, I personally feel we should consider ripping that distinction if it's OK. But I also feel that if we do chose to do that, the change belongs in a separate revision, so this patch is the right first step either way. John --- ChangeLog | 4 + config.sub| 320 +- testsuite/config-sub.data | 4 +- 3 files changed, 123 insertions(+), 205 deletions(-) diff --git a/ChangeLog b/ChangeLog index 372559c..8586152 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2018-06-22 John Ericson + + * config.sub: Deduplicate `basic_machine` by always allowing the vendor + 2018-05-24 Ben Elliston * testsuite/config-sub.data: Add tests for Sequent and DYNIX/ptx. diff --git a/config.sub b/config.sub index d1f5b54..8b6e358 100755 --- a/config.sub +++ b/config.sub @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2018-05-24' +timestamp='2018-06-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -124,6 +124,7 @@ case $1 in *-*-*-*) basic_machine=$field1-$field2 os=$field3-$field4 + vendor_inferred= ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two @@ -135,16 +136,19 @@ case $1 in | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) - basic_machine=$field1 + basic_machine=$field1-unknown os=$maybe_os + vendor_inferred=1 ;; android-linux) basic_machine=$field1-unknown os=linux-android + vendor_inferred= ;; *) basic_machine=$field1-$field2 os=$field3 + vendor_inferred= ;; esac ;; @@ -153,8 +157,9 @@ case $1 in case $field2 in # Prevent following clause from handling this valid os sun*os*) - basic_machine=$field1 + basic_machine=$field1-unknown os=$field2 + vendor_inferred=1 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc532* | sgi* | sony* \ @@ -167,19 +172,22 @@ case $1 in | sim | cisco | oki | wec | wrs | winbond) basic_machine=$field1-$field2 os= + vendor_inferred= ;; *) - basic_machine=$field1 + basic_machine=$field1-unknown os=$field2 + vendor_inferred=1 ;; esac ;; *) + vendor_inferred=1 # Convert single-component short-hands not valid as part