Skip to content

Commit 74af13c

Browse files
committed
config.sub, config.guess : Import upstream 2021-01-25.
Hi Does it update config.sub and config.guess, I know it's already stage 4, but the config.* stuff update should be harmless things, and we need this for RISC-V big-endian support, which is already supported in binutils 2.36. This imports from: sha1 6faca61810d335c7837f320733fe8e15a1431fc2 ChangeLog: * config.guess: Import latest upstream. * config.sub: Import latest upstream.
1 parent 37b64a3 commit 74af13c

File tree

2 files changed

+46
-25
lines changed

2 files changed

+46
-25
lines changed

Diff for: config.guess

+31-17
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#! /bin/sh
22
# Attempt to guess a canonical system name.
3-
# Copyright 1992-2020 Free Software Foundation, Inc.
3+
# Copyright 1992-2021 Free Software Foundation, Inc.
44

5-
timestamp='2020-11-07'
5+
timestamp='2021-01-25'
66

77
# This file is free software; you can redistribute it and/or modify it
88
# under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@ timestamp='2020-11-07'
2727
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
2828
#
2929
# You can get the latest version of this script from:
30-
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
30+
# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
3131
#
3232
# Please send patches to <[email protected]>.
3333

@@ -50,7 +50,7 @@ version="\
5050
GNU config.guess ($timestamp)
5151
5252
Originally written by Per Bothner.
53-
Copyright 1992-2020 Free Software Foundation, Inc.
53+
Copyright 1992-2021 Free Software Foundation, Inc.
5454
5555
This is free software; see the source for copying conditions. There is NO
5656
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -138,9 +138,7 @@ UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown
138138

139139
case "$UNAME_SYSTEM" in
140140
Linux|GNU|GNU/*)
141-
# If the system lacks a compiler, then just pick glibc.
142-
# We could probably try harder.
143-
LIBC=gnu
141+
LIBC=unknown
144142

145143
set_cc_for_build
146144
cat <<-EOF > "$dummy.c"
@@ -149,16 +147,30 @@ Linux|GNU|GNU/*)
149147
LIBC=uclibc
150148
#elif defined(__dietlibc__)
151149
LIBC=dietlibc
150+
#elif defined(__GLIBC__)
151+
LIBC=gnu
152152
#else
153153
#include <stdarg.h>
154+
/* First heuristic to detect musl libc. */
154155
#ifdef __DEFINED_va_list
155156
LIBC=musl
156-
#else
157-
LIBC=gnu
158157
#endif
159158
#endif
160159
EOF
161160
eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')"
161+
162+
# Second heuristic to detect musl libc.
163+
if [ "$LIBC" = unknown ] &&
164+
command -v ldd >/dev/null &&
165+
ldd --version 2>&1 | grep -q ^musl; then
166+
LIBC=musl
167+
fi
168+
169+
# If the system lacks a compiler, then just pick glibc.
170+
# We could probably try harder.
171+
if [ "$LIBC" = unknown ]; then
172+
LIBC=gnu
173+
fi
162174
;;
163175
esac
164176

@@ -176,10 +188,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
176188
#
177189
# Note: NetBSD doesn't particularly care about the vendor
178190
# portion of the name. We always set it to "unknown".
179-
sysctl="sysctl -n hw.machine_arch"
180191
UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
181-
"/sbin/$sysctl" 2>/dev/null || \
182-
"/usr/sbin/$sysctl" 2>/dev/null || \
192+
/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
193+
/usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
183194
echo unknown))
184195
case "$UNAME_MACHINE_ARCH" in
185196
aarch64eb) machine=aarch64_be-unknown ;;
@@ -984,6 +995,9 @@ EOF
984995
k1om:Linux:*:*)
985996
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
986997
exit ;;
998+
loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
999+
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1000+
exit ;;
9871001
m32r*:Linux:*:*)
9881002
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9891003
exit ;;
@@ -1072,7 +1086,7 @@ EOF
10721086
ppcle:Linux:*:*)
10731087
echo powerpcle-unknown-linux-"$LIBC"
10741088
exit ;;
1075-
riscv32:Linux:*:* | riscv64:Linux:*:*)
1089+
riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
10761090
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10771091
exit ;;
10781092
s390:Linux:*:* | s390x:Linux:*:*)
@@ -1468,8 +1482,8 @@ EOF
14681482
i*86:rdos:*:*)
14691483
echo "$UNAME_MACHINE"-pc-rdos
14701484
exit ;;
1471-
i*86:AROS:*:*)
1472-
echo "$UNAME_MACHINE"-pc-aros
1485+
*:AROS:*:*)
1486+
echo "$UNAME_MACHINE"-unknown-aros
14731487
exit ;;
14741488
x86_64:VMkernel:*:*)
14751489
echo "$UNAME_MACHINE"-unknown-esx
@@ -1638,9 +1652,9 @@ This script (version $timestamp), has failed to recognize the
16381652
operating system you are using. If your script is old, overwrite *all*
16391653
copies of config.guess and config.sub with the latest versions from:
16401654
1641-
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
1655+
https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
16421656
and
1643-
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1657+
https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
16441658
EOF
16451659

16461660
year=$(echo $timestamp | sed 's,-.*,,')

Diff for: config.sub

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#! /bin/sh
22
# Configuration validation subroutine script.
3-
# Copyright 1992-2020 Free Software Foundation, Inc.
3+
# Copyright 1992-2021 Free Software Foundation, Inc.
44

5-
timestamp='2020-11-07'
5+
timestamp='2021-01-08'
66

77
# This file is free software; you can redistribute it and/or modify it
88
# under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ timestamp='2020-11-07'
3333
# Otherwise, we print the canonical config type on stdout and succeed.
3434

3535
# You can get the latest version of this script from:
36-
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
36+
# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
3737

3838
# This file is supposed to be the same for all GNU packages
3939
# and recognize all the CPU types, system types and aliases
@@ -67,7 +67,7 @@ Report bugs and patches to <[email protected]>."
6767
version="\
6868
GNU config.sub ($timestamp)
6969
70-
Copyright 1992-2020 Free Software Foundation, Inc.
70+
Copyright 1992-2021 Free Software Foundation, Inc.
7171
7272
This is free software; see the source for copying conditions. There is NO
7373
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -1185,6 +1185,7 @@ case $cpu-$vendor in
11851185
| k1om \
11861186
| le32 | le64 \
11871187
| lm32 \
1188+
| loongarch32 | loongarch64 | loongarchx32 \
11881189
| m32c | m32r | m32rle \
11891190
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
11901191
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
@@ -1229,7 +1230,7 @@ case $cpu-$vendor in
12291230
| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
12301231
| pru \
12311232
| pyramid \
1232-
| riscv | riscv32 | riscv64 \
1233+
| riscv | riscv32 | riscv32be | riscv64 | riscv64be \
12331234
| rl78 | romp | rs6000 | rx \
12341235
| s390 | s390x \
12351236
| score \
@@ -1241,6 +1242,7 @@ case $cpu-$vendor in
12411242
| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
12421243
| spu \
12431244
| tahoe \
1245+
| thumbv7* \
12441246
| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
12451247
| tron \
12461248
| ubicom32 \
@@ -1681,11 +1683,14 @@ fi
16811683

16821684
# Now, validate our (potentially fixed-up) OS.
16831685
case $os in
1684-
# Sometimes we do "kernel-abi", so those need to count as OSes.
1686+
# Sometimes we do "kernel-libc", so those need to count as OSes.
16851687
musl* | newlib* | uclibc*)
16861688
;;
1687-
# Likewise for "kernel-libc"
1688-
eabi | eabihf | gnueabi | gnueabihf)
1689+
# Likewise for "kernel-abi"
1690+
eabi* | gnueabi*)
1691+
;;
1692+
# VxWorks passes extra cpu info in the 4th filed.
1693+
simlinux | simwindows | spe)
16891694
;;
16901695
# Now accept the basic system types.
16911696
# The portable systems comes first.
@@ -1749,6 +1754,8 @@ case $kernel-$os in
17491754
;;
17501755
kfreebsd*-gnu* | kopensolaris*-gnu*)
17511756
;;
1757+
vxworks-simlinux | vxworks-simwindows | vxworks-spe)
1758+
;;
17521759
nto-qnx*)
17531760
;;
17541761
os2-emx)

0 commit comments

Comments
 (0)