config.guess (aarch64:Linux:*:*): Detect 32-bit ABI

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>
This commit is contained in:
Dmitry V. Levin 2023-07-20 16:40:00 +00:00
parent 602766470c
commit af8d803a82
2 changed files with 23 additions and 3 deletions

24
config.guess vendored
View File

@ -4,7 +4,7 @@
# shellcheck disable=SC2006,SC2268 # see below for rationale
timestamp='2023-07-19'
timestamp='2023-07-20'
# 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
@ -976,7 +976,27 @@ EOF
GUESS=$UNAME_MACHINE-unknown-minix
;;
aarch64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
set_cc_for_build
CPU=$UNAME_MACHINE
LIBCABI=$LIBC
if test "$CC_FOR_BUILD" != no_compiler_found; then
ABI=64
sed 's/^ //' << EOF > "$dummy.c"
#ifdef __ARM_EABI__
#ifdef __ARM_PCS_VFP
ABI=eabihf
#else
ABI=eabi
#endif
#endif
EOF
cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
eval "$cc_set_abi"
case $ABI in
eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
esac
fi
GUESS=$CPU-unknown-linux-$LIBCABI
;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be

View File

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5.
.TH CONFIG.GUESS "1" "July 2023" "GNU config.guess (2023-07-19)" "User Commands"
.TH CONFIG.GUESS "1" "July 2023" "GNU config.guess (2023-07-20)" "User Commands"
.SH NAME
config.guess \- guess the build system triplet
.SH SYNOPSIS