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

* 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.
This commit is contained in:
Bruno Haible 2022-05-08 19:08:08 +02:00 committed by Dmitry V. Levin
parent 8a9de2bc05
commit f56a714038
2 changed files with 20 additions and 9 deletions

27
config.guess vendored
View File

@ -4,7 +4,7 @@
# shellcheck disable=SC2006,SC2268 # see below for rationale # shellcheck disable=SC2006,SC2268 # see below for rationale
timestamp='2022-01-09' timestamp='2022-05-08'
# This file is free software; you can redistribute it and/or modify it # 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 # under the terms of the GNU General Public License as published by
@ -1151,16 +1151,27 @@ EOF
;; ;;
x86_64:Linux:*:*) x86_64:Linux:*:*)
set_cc_for_build set_cc_for_build
CPU=$UNAME_MACHINE
LIBCABI=$LIBC LIBCABI=$LIBC
if test "$CC_FOR_BUILD" != no_compiler_found; then if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ ABI=64
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ sed 's/^ //' << EOF > "$dummy.c"
grep IS_X32 >/dev/null #ifdef __i386__
then ABI=x86
LIBCABI=${LIBC}x32 #else
fi #ifdef __ILP32__
ABI=x32
#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
x86) CPU=i686 ;;
x32) LIBCABI=${LIBC}x32 ;;
esac
fi fi
GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI GUESS=$CPU-pc-linux-$LIBCABI
;; ;;
xtensa*:Linux:*:*) xtensa*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC GUESS=$UNAME_MACHINE-unknown-linux-$LIBC

View File

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5.
.TH CONFIG.GUESS "1" "January 2022" "GNU config.guess (2022-01-09)" "User Commands" .TH CONFIG.GUESS "1" "May 2022" "GNU config.guess (2022-05-08)" "User Commands"
.SH NAME .SH NAME
config.guess \- guess the build system triplet config.guess \- guess the build system triplet
.SH SYNOPSIS .SH SYNOPSIS