From e959fd87fe8dda4e596adaf28c0c52e431a2bdf1 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: John Ericson Date: Fri, 22 Jun 2018 17:40:14 -0400 Subject: [PATCH 6/6] * config.sub: Deduplicate `basic_machine` by filling in a stub vendor. To: address@hidden --- ChangeLog | 24 +++++++ config.sub | 203 +++++++++++++---------------------------------------- 2 files changed, 74 insertions(+), 153 deletions(-) diff --git a/ChangeLog b/ChangeLog index 20cff86..0a65d0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2018-07-23 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-08 John Ericson * config.sub: Combine match arms diff --git a/config.sub b/config.sub index bab5bf7..2e4a661 100755 --- a/config.sub +++ b/config.sub @@ -622,15 +622,36 @@ 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 + ;; + *) + 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) @@ -642,31 +663,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) @@ -678,131 +699,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-* \ @@ -898,10 +798,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) @@ -937,14 +833,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) @@ -963,7 +862,7 @@ case $basic_machine in | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; - dpx20 | dpx20-*) + dpx20-*) basic_machine=rs6000-bull os=${os:-bosx} ;; @@ -1062,6 +961,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 ;; @@ -1137,12 +1040,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/^[^-]*-//'` ;; @@ -1217,15 +1117,15 @@ case $basic_machine in sb1el) basic_machine=mipsisa64sb1el-unknown ;; - sde) + sde-unknown) basic_machine=mipsisa32-sde os=${os:-elf} ;; - sequent) + sequent-unknown) basic_machine=i386-sequent ;; - 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/^[^-]*-//'` @@ -1241,9 +1141,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) @@ -1266,8 +1163,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