From 8de7981fd45505acfd4aa266290a5ec54a119ef3 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 8 May 2022 19:08:08 +0200 Subject: [PATCH 1/2] config.guess (x86_64:Linux:*:*): Detect 32-bit ABI. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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. --- config.guess | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/config.guess b/config.guess index 7f76b62..f953bc9 100755 --- a/config.guess +++ b/config.guess @@ -4,7 +4,7 @@ # 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 # under the terms of the GNU General Public License as published by @@ -1151,16 +1151,24 @@ EOF ;; x86_64:Linux:*:*) set_cc_for_build + CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then - if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + if (echo '#ifdef __i386__'; echo IS_X86; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_X32 >/dev/null + grep IS_X86 >/dev/null then - LIBCABI=${LIBC}x32 + CPU=i686 + else + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI=${LIBC}x32 + fi fi fi - GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI + GUESS=$CPU-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC -- 2.25.1