Starting with commit afe1fa96bf32, "uname -p" from PATH is invoked in
case of FreeBSD on arm, while in other FreeBSD cases it was invoked
using a full pathname as "/usr/bin/uname -p". Fix this inconsistency
and invoke "uname -p" from PATH for all FreeBSD cases. This also allows
to test non-arm FreeBSD cases.
* config.guess (*:FreeBSD:*:*): Invoke "uname -p" from PATH.
* doc/config.guess.1: Regenerate.
* testsuite/config-guess.data (x86_64-unknown-freebsd5.2,
i586-unknown-freebsd7.0): Reintroduce the tests removed by commit
68873f3c11c6.
Here's a patch to recognize Android environments.
Such environments are "apps" with POSIX-like tools. Today, the most frequently
used one is Termux [1][2][3]; on devices with Android versions before 5.0
one can use Terminal-IDE [4][5].
config.sub already supports this environment:
$ sh config.sub armv7l-linux-androideabi
armv7l-unknown-linux-androideabi
I've built many GNU packages in this environment, with the following recipe:
CONFIG_SHELL=$PREFIX/bin/sh; export CONFIG_SHELL
CC="clang -ferror-limit=0" CXX="clang++ -ferror-limit=0"; export CC CXX
./configure --host=armv7l-linux-androideabi --prefix=$HOME/local
The Termux people have compiled or ported more than 1000 packages as well [6].
But the requirement to pass the --host parameter each time is an annoyance.
Without it, based only on the results of uname, config.guess guesses
$ sh config.guess
armv7l-unknown-linux-gnueabi
and many configuration results are wrong (because Android has many functions
in libc without declaring them in the .h files, depending on the so-called
"Android API level"), leading to many compilation errors.
With the attached patch, it produces
$ sh config.guess
armv7l-unknown-linux-androideabi
The patch does not include an addition to the config.guess test suite, since
the uname values are:
$ uname -m
armv7l
$ uname -r
4.19.127
$ uname -s
Linux
$ uname -v
#1 SMP PREEMPT Tue Apr 4 16:54:58 IST 2023
$ uname -p
unknown
which maps to armv7l-unknown-linux-gnueabi.
[1] https://github.com/termux/termux-app
[2] https://f-droid.org/en/packages/com.termux/
[3] https://wiki.termux.com/wiki/Main_Page
[4] https://en.wikibooks.org/wiki/Android/Terminal_IDE
[5] http://www.spartacusrex.com/terminalide.htm
[6] https://github.com/termux/termux-packages/tree/master/packages
* config.guess (Linux|GNU|GNU/*): Detect Android.
* doc/config.guess.1: Regenerate.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
On x86_64 Linux, a C compiler producing 32bit code causes the guessed
CPU to be changed to i686.
Adapt this approach for aarch64 Linux, i.e. change the guessed CPU
to armv8l when a compiler producing arm eabi code is detected.
* config.guess (aarch64:Linux:*:*): Test for the 32-bit ABI.
* doc/config.guess.1: Regenerate.
Suggested-by: David Allsopp <david.allsopp@metastack.com>
In 2012 the GNU Coding Standards changed to recommend quoting
'like this' or "like this" instead of `like this'.
Alter diagnostics and comments accordingly.
Use a more-consistent quoting style in config.sub diagnostics,
preferring 'like this' to "like this" as the former is more
resistant to shell metacharacters.
* config.guess (x86_64:Linux:*:*): Test for the 32-bit ABI. Don't assume that
__ILP32__ is a certain indicator for the x32 ABI; for GCC ≥ 9 it no longer is.
* doc/config.guess.1: Regenerate.
See: https://www.gnu.org/licenses/gpl-3.0.html#howto
Update license headers automatically using the following script:
$ git grep -l 'Foundation; either version 3' \
| xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/'
* config.guess: Adjust via the above command.
(timestamp): Update.
* config.sub: Likewise.
* doc/config.guess.1: Regenerate.
* doc/config.sub.1: Likewise.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
config.guess guesses Solaris 11 to run on a 32-bit platform
despite Solaris 11 no longer supporting any 32-bit platform.
See the following code at lines 434 to 445:
| SUN_ARCH=i386
| # If there is a compiler, see if it is configured for 64-bit objects.
| # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
| # This test works for both compilers.
| if test "$CC_FOR_BUILD" != no_compiler_found; then
| if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
| (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
| grep IS_64BIT_ARCH >/dev/null
| then
| SUN_ARCH=x86_64
| fi
| fi
If "cc" is installed, i.e. the Oracle Studio compiler, this one is
chosen for $CC_FOR_BUILD. This compiler, the gcc provided by Oracle
and also gcc bootstrapped from sources on that platform with a default
configuration will by default generate 32-bit binaries -- even on
a 64-bit platform. And __amd64 will not be defined for compilations
targeting a 32-bit platform. This is different from the corresponding
behaviour on GNU/Linux systems where the local platform is targeted by
default.
Thus, as long as you do not add "-m64" or if you have a custom-built
gcc which defaults to 64 bit, you will get 32-bit binaries on Solaris
despite living on a 64-bit platform.
* config.guess (i86pc:SunOS:5.*:* || i86xen:SunOS:5.*:*): Adapt the
test by adding the "-m64" flag. This will work properly for Solaris
10 as well (the last Solaris release that supported x86 32-bit
platforms).
* doc/config.guess.1: Regenerate.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Commit 29865ea8a5622cdd80b7a69a0afa78004b4cd311 introduced an exit trap
reset before exiting to avoid a spurious non-zero exit status on
alphaev67-dec-osf5.1. Simplify that code a bit by moving the exit trap
reset around.
* config.guess (alpha:OSF1:*:*): Reset exit trap earlier.
* doc/config.guess.1: Regenerate.
* config.guess (*:NetBSD:*:*): Spell out the full sysctl command twice
instead of using a shell variable.
* doc/config.guess.1: Regenerate.
Fixes: 827c77253b396c07306927b2a4b794a3251c48eb
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Recently RISC-V community got patches big-endian support for binutils,
and we'd like to accept that, however before accepting that I think it
would be better to upstream config.sub and config.guess change here :)
It's my check result on Ubuntu 18.04:
$ make check
cd testsuite && bash config-guess.sh && rm uname
PASS: config.guess checks (131 tests)
cd testsuite && bash config-sub.sh
PASS: config.sub checks (830 tests)
PASS: config.sub idempotency checks (767 tests)
PASS: config.sub canonicalise each config.guess testcase (131 tests)
* config.guess (riscv32be:Linux:*:*, riscv64be:Linux:*:*): Recognize.
* config.sub (riscv32be, riscv64be): Likewise.
* doc/config.guess.1: Regenerate.
* doc/config.sub.1: Likewise.
* testsuite/config-guess.data: Add test cases for riscv32be, and riscv64be.
* testsuite/config-sub.data (riscv32be, riscv64be): Add test cases.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>