summaryrefslogtreecommitdiffstats
path: root/config.sub
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-12-17 09:56:21 +0100
committerMartin Liska <mliska@suse.cz>2021-12-17 10:54:16 +0100
commit80091f9426809d3cba111025e7e1e943d952e2f1 (patch)
tree24a57db91409197356efcd06240c50c15ce87dbb /config.sub
parentDarwin, Driver: Avoid a link line for empty commands. (diff)
downloadgcc-80091f9426809d3cba111025e7e1e943d952e2f1.tar.gz
gcc-80091f9426809d3cba111025e7e1e943d952e2f1.tar.bz2
gcc-80091f9426809d3cba111025e7e1e943d952e2f1.tar.xz
Sync config.sub: 2021-10-27
ChangeLog: * config.sub: Sync from master.
Diffstat (limited to 'config.sub')
-rw-r--r--[-rwxr-xr-x]config.sub81
1 files changed, 53 insertions, 28 deletions
diff --git a/config.sub b/config.sub
index 63c1f1c8b5e..38f3d037a78 100755..100644
--- a/config.sub
+++ b/config.sub
@@ -2,7 +2,9 @@
2# Configuration validation subroutine script. 2# Configuration validation subroutine script.
3# Copyright 1992-2021 Free Software Foundation, Inc. 3# Copyright 1992-2021 Free Software Foundation, Inc.
4 4
5timestamp='2021-01-08' 5# shellcheck disable=SC2006,SC2268 # see below for rationale
6
7timestamp='2021-10-27'
6 8
7# This file is free software; you can redistribute it and/or modify it 9# This file is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by 10# under the terms of the GNU General Public License as published by
@@ -50,7 +52,14 @@ timestamp='2021-01-08'
50# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM 52# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
51# It is wrong to echo any other type of specification. 53# It is wrong to echo any other type of specification.
52 54
53me=$(echo "$0" | sed -e 's,.*/,,') 55# The "shellcheck disable" line above the timestamp inhibits complaints
56# about features and limitations of the classic Bourne shell that were
57# superseded or lifted in POSIX. However, this script identifies a wide
58# variety of pre-POSIX systems that do not have POSIX shells at all, and
59# even some reasonably current systems (Solaris 10 as case-in-point) still
60# have a pre-POSIX /bin/sh.
61
62me=`echo "$0" | sed -e 's,.*/,,'`
54 63
55usage="\ 64usage="\
56Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS 65Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
@@ -112,9 +121,11 @@ esac
112 121
113# Split fields of configuration type 122# Split fields of configuration type
114# shellcheck disable=SC2162 123# shellcheck disable=SC2162
124saved_IFS=$IFS
115IFS="-" read field1 field2 field3 field4 <<EOF 125IFS="-" read field1 field2 field3 field4 <<EOF
116$1 126$1
117EOF 127EOF
128IFS=$saved_IFS
118 129
119# Separate into logical components for further validation 130# Separate into logical components for further validation
120case $1 in 131case $1 in
@@ -163,6 +174,10 @@ case $1 in
163 basic_machine=$field1 174 basic_machine=$field1
164 basic_os=$field2 175 basic_os=$field2
165 ;; 176 ;;
177 zephyr*)
178 basic_machine=$field1-unknown
179 basic_os=$field2
180 ;;
166 # Manufacturers 181 # Manufacturers
167 dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ 182 dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
168 | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ 183 | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
@@ -769,22 +784,22 @@ case $basic_machine in
769 vendor=hp 784 vendor=hp
770 ;; 785 ;;
771 i*86v32) 786 i*86v32)
772 cpu=$(echo "$1" | sed -e 's/86.*/86/') 787 cpu=`echo "$1" | sed -e 's/86.*/86/'`
773 vendor=pc 788 vendor=pc
774 basic_os=sysv32 789 basic_os=sysv32
775 ;; 790 ;;
776 i*86v4*) 791 i*86v4*)
777 cpu=$(echo "$1" | sed -e 's/86.*/86/') 792 cpu=`echo "$1" | sed -e 's/86.*/86/'`
778 vendor=pc 793 vendor=pc
779 basic_os=sysv4 794 basic_os=sysv4
780 ;; 795 ;;
781 i*86v) 796 i*86v)
782 cpu=$(echo "$1" | sed -e 's/86.*/86/') 797 cpu=`echo "$1" | sed -e 's/86.*/86/'`
783 vendor=pc 798 vendor=pc
784 basic_os=sysv 799 basic_os=sysv
785 ;; 800 ;;
786 i*86sol2) 801 i*86sol2)
787 cpu=$(echo "$1" | sed -e 's/86.*/86/') 802 cpu=`echo "$1" | sed -e 's/86.*/86/'`
788 vendor=pc 803 vendor=pc
789 basic_os=solaris2 804 basic_os=solaris2
790 ;; 805 ;;
@@ -917,14 +932,16 @@ case $basic_machine in
917 ;; 932 ;;
918 leon-*|leon[3-9]-*) 933 leon-*|leon[3-9]-*)
919 cpu=sparc 934 cpu=sparc
920 vendor=$(echo "$basic_machine" | sed 's/-.*//') 935 vendor=`echo "$basic_machine" | sed 's/-.*//'`
921 ;; 936 ;;
922 937
923 *-*) 938 *-*)
924 # shellcheck disable=SC2162 939 # shellcheck disable=SC2162
940 saved_IFS=$IFS
925 IFS="-" read cpu vendor <<EOF 941 IFS="-" read cpu vendor <<EOF
926$basic_machine 942$basic_machine
927EOF 943EOF
944 IFS=$saved_IFS
928 ;; 945 ;;
929 # We use `pc' rather than `unknown' 946 # We use `pc' rather than `unknown'
930 # because (1) that's what they normally are, and 947 # because (1) that's what they normally are, and
@@ -1084,7 +1101,7 @@ case $cpu-$vendor in
1084 cpu=mipsisa64sb1el 1101 cpu=mipsisa64sb1el
1085 ;; 1102 ;;
1086 sh5e[lb]-*) 1103 sh5e[lb]-*)
1087 cpu=$(echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/') 1104 cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
1088 ;; 1105 ;;
1089 spur-*) 1106 spur-*)
1090 cpu=spur 1107 cpu=spur
@@ -1102,7 +1119,7 @@ case $cpu-$vendor in
1102 cpu=x86_64 1119 cpu=x86_64
1103 ;; 1120 ;;
1104 xscale-* | xscalee[bl]-*) 1121 xscale-* | xscalee[bl]-*)
1105 cpu=$(echo "$cpu" | sed 's/^xscale/arm/') 1122 cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
1106 ;; 1123 ;;
1107 arm64-*) 1124 arm64-*)
1108 cpu=aarch64 1125 cpu=aarch64
@@ -1165,7 +1182,7 @@ case $cpu-$vendor in
1165 | alphapca5[67] | alpha64pca5[67] \ 1182 | alphapca5[67] | alpha64pca5[67] \
1166 | am33_2.0 \ 1183 | am33_2.0 \
1167 | amdgcn \ 1184 | amdgcn \
1168 | arc | arceb \ 1185 | arc | arceb | arc32 | arc64 \
1169 | arm | arm[lb]e | arme[lb] | armv* \ 1186 | arm | arm[lb]e | arme[lb] | armv* \
1170 | avr | avr32 \ 1187 | avr | avr32 \
1171 | asmjs \ 1188 | asmjs \
@@ -1204,9 +1221,13 @@ case $cpu-$vendor in
1204 | mips64vr5900 | mips64vr5900el \ 1221 | mips64vr5900 | mips64vr5900el \
1205 | mipsisa32 | mipsisa32el \ 1222 | mipsisa32 | mipsisa32el \
1206 | mipsisa32r2 | mipsisa32r2el \ 1223 | mipsisa32r2 | mipsisa32r2el \
1224 | mipsisa32r3 | mipsisa32r3el \
1225 | mipsisa32r5 | mipsisa32r5el \
1207 | mipsisa32r6 | mipsisa32r6el \ 1226 | mipsisa32r6 | mipsisa32r6el \
1208 | mipsisa64 | mipsisa64el \ 1227 | mipsisa64 | mipsisa64el \
1209 | mipsisa64r2 | mipsisa64r2el \ 1228 | mipsisa64r2 | mipsisa64r2el \
1229 | mipsisa64r3 | mipsisa64r3el \
1230 | mipsisa64r5 | mipsisa64r5el \
1210 | mipsisa64r6 | mipsisa64r6el \ 1231 | mipsisa64r6 | mipsisa64r6el \
1211 | mipsisa64sb1 | mipsisa64sb1el \ 1232 | mipsisa64sb1 | mipsisa64sb1el \
1212 | mipsisa64sr71k | mipsisa64sr71kel \ 1233 | mipsisa64sr71k | mipsisa64sr71kel \
@@ -1283,35 +1304,37 @@ esac
1283if test x$basic_os != x 1304if test x$basic_os != x
1284then 1305then
1285 1306
1286# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just 1307# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
1287# set os. 1308# set os.
1288case $basic_os in 1309case $basic_os in
1289 gnu/linux*) 1310 gnu/linux*)
1290 kernel=linux 1311 kernel=linux
1291 os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|') 1312 os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
1292 ;; 1313 ;;
1293 os2-emx) 1314 os2-emx)
1294 kernel=os2 1315 kernel=os2
1295 os=$(echo $basic_os | sed -e 's|os2-emx|emx|') 1316 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
1296 ;; 1317 ;;
1297 nto-qnx*) 1318 nto-qnx*)
1298 kernel=nto 1319 kernel=nto
1299 os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|') 1320 os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
1300 ;; 1321 ;;
1301 *-*) 1322 *-*)
1302 # shellcheck disable=SC2162 1323 # shellcheck disable=SC2162
1324 saved_IFS=$IFS
1303 IFS="-" read kernel os <<EOF 1325 IFS="-" read kernel os <<EOF
1304$basic_os 1326$basic_os
1305EOF 1327EOF
1328 IFS=$saved_IFS
1306 ;; 1329 ;;
1307 # Default OS when just kernel was specified 1330 # Default OS when just kernel was specified
1308 nto*) 1331 nto*)
1309 kernel=nto 1332 kernel=nto
1310 os=$(echo $basic_os | sed -e 's|nto|qnx|') 1333 os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
1311 ;; 1334 ;;
1312 linux*) 1335 linux*)
1313 kernel=linux 1336 kernel=linux
1314 os=$(echo $basic_os | sed -e 's|linux|gnu|') 1337 os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
1315 ;; 1338 ;;
1316 *) 1339 *)
1317 kernel= 1340 kernel=
@@ -1332,7 +1355,7 @@ case $os in
1332 os=cnk 1355 os=cnk
1333 ;; 1356 ;;
1334 solaris1 | solaris1.*) 1357 solaris1 | solaris1.*)
1335 os=$(echo $os | sed -e 's|solaris1|sunos4|') 1358 os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
1336 ;; 1359 ;;
1337 solaris) 1360 solaris)
1338 os=solaris2 1361 os=solaris2
@@ -1361,7 +1384,7 @@ case $os in
1361 os=sco3.2v4 1384 os=sco3.2v4
1362 ;; 1385 ;;
1363 sco3.2.[4-9]*) 1386 sco3.2.[4-9]*)
1364 os=$(echo $os | sed -e 's/sco3.2./sco3.2v/') 1387 os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
1365 ;; 1388 ;;
1366 sco*v* | scout) 1389 sco*v* | scout)
1367 # Don't match below 1390 # Don't match below
@@ -1391,7 +1414,7 @@ case $os in
1391 os=lynxos 1414 os=lynxos
1392 ;; 1415 ;;
1393 mac[0-9]*) 1416 mac[0-9]*)
1394 os=$(echo "$os" | sed -e 's|mac|macos|') 1417 os=`echo "$os" | sed -e 's|mac|macos|'`
1395 ;; 1418 ;;
1396 opened*) 1419 opened*)
1397 os=openedition 1420 os=openedition
@@ -1400,10 +1423,10 @@ case $os in
1400 os=os400 1423 os=os400
1401 ;; 1424 ;;
1402 sunos5*) 1425 sunos5*)
1403 os=$(echo "$os" | sed -e 's|sunos5|solaris2|') 1426 os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
1404 ;; 1427 ;;
1405 sunos6*) 1428 sunos6*)
1406 os=$(echo "$os" | sed -e 's|sunos6|solaris3|') 1429 os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
1407 ;; 1430 ;;
1408 wince*) 1431 wince*)
1409 os=wince 1432 os=wince
@@ -1437,7 +1460,7 @@ case $os in
1437 ;; 1460 ;;
1438 # Preserve the version number of sinix5. 1461 # Preserve the version number of sinix5.
1439 sinix5.*) 1462 sinix5.*)
1440 os=$(echo $os | sed -e 's|sinix|sysv|') 1463 os=`echo "$os" | sed -e 's|sinix|sysv|'`
1441 ;; 1464 ;;
1442 sinix*) 1465 sinix*)
1443 os=sysv4 1466 os=sysv4
@@ -1684,7 +1707,7 @@ fi
1684# Now, validate our (potentially fixed-up) OS. 1707# Now, validate our (potentially fixed-up) OS.
1685case $os in 1708case $os in
1686 # Sometimes we do "kernel-libc", so those need to count as OSes. 1709 # Sometimes we do "kernel-libc", so those need to count as OSes.
1687 musl* | newlib* | uclibc*) 1710 musl* | newlib* | relibc* | uclibc*)
1688 ;; 1711 ;;
1689 # Likewise for "kernel-abi" 1712 # Likewise for "kernel-abi"
1690 eabi* | gnueabi*) 1713 eabi* | gnueabi*)
@@ -1707,12 +1730,12 @@ case $os in
1707 | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ 1730 | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
1708 | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ 1731 | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
1709 | mirbsd* | netbsd* | dicos* | openedition* | ose* \ 1732 | mirbsd* | netbsd* | dicos* | openedition* | ose* \
1710 | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ 1733 | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
1711 | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ 1734 | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
1712 | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ 1735 | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
1713 | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ 1736 | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
1714 | udi* | lites* | ieee* | go32* | aux* | hcos* \ 1737 | udi* | lites* | ieee* | go32* | aux* | hcos* \
1715 | chorusrdb* | cegcc* | glidix* \ 1738 | chorusrdb* | cegcc* | glidix* | serenity* \
1716 | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ 1739 | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
1717 | midipix* | mingw32* | mingw64* | mint* \ 1740 | midipix* | mingw32* | mingw64* | mint* \
1718 | uxpv* | beos* | mpeix* | udk* | moxiebox* \ 1741 | uxpv* | beos* | mpeix* | udk* | moxiebox* \
@@ -1725,7 +1748,8 @@ case $os in
1725 | skyos* | haiku* | rdos* | toppers* | drops* | es* \ 1748 | skyos* | haiku* | rdos* | toppers* | drops* | es* \
1726 | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 1749 | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1727 | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ 1750 | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
1728 | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*) 1751 | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
1752 | fiwix* )
1729 ;; 1753 ;;
1730 # This one is extra strict with allowed versions 1754 # This one is extra strict with allowed versions
1731 sco3.2v2 | sco3.2v[4-9]* | sco5v6*) 1755 sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
@@ -1742,11 +1766,12 @@ esac
1742# As a final step for OS-related things, validate the OS-kernel combination 1766# As a final step for OS-related things, validate the OS-kernel combination
1743# (given a valid OS), if there is a kernel. 1767# (given a valid OS), if there is a kernel.
1744case $kernel-$os in 1768case $kernel-$os in
1745 linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) 1769 linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
1770 | linux-musl* | linux-relibc* | linux-uclibc* )
1746 ;; 1771 ;;
1747 uclinux-uclibc* ) 1772 uclinux-uclibc* )
1748 ;; 1773 ;;
1749 -dietlibc* | -newlib* | -musl* | -uclibc* ) 1774 -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
1750 # These are just libc implementations, not actual OSes, and thus 1775 # These are just libc implementations, not actual OSes, and thus
1751 # require a kernel. 1776 # require a kernel.
1752 echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 1777 echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2