libffi/x86: Always check __x86_64__ for x86 hosts
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 5 Jul 2021 21:15:04 +0000 (14:15 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 9 Jul 2021 21:30:58 +0000 (14:30 -0700)
The upstream libffi has

commit cb8474368cdef3207638d047bd6c707ad8fcb339
Author: hjl-tools <hjl.tools@gmail.com>
Date:   Wed Dec 2 12:52:12 2020 -0800

    libffi/x86: Always check __x86_64__ for x32 hosts (#601) (#602)

    Since for x86_64-*x32 and x86_64-x32-* hosts, -m32 generates ia32 codes.
    We should always check __x86_64__ for x32 hosts.

Since for gnux32 hosts, -m32 generates i386 codes, always check __x86_64__
for x86 hosts.

PR libffi/101336
* configure.host: Always check __x86_64__ for x86 hosts.

libffi/configure.host

index 786b32c..7248acb 100644 (file)
@@ -95,20 +95,13 @@ case "${host}" in
   i?86-*-* | x86_64-*-* | amd64-*)
        TARGETDIR=x86
        if test $ac_cv_sizeof_size_t = 4; then
-         case "$host" in
-           *-gnux32)
-             TARGET=X86_64
-             ;;
-           *)
-             echo 'int foo (void) { return __x86_64__; }' > conftest.c
-             if $CC $CFLAGS -Werror -S conftest.c -o conftest.s > /dev/null 2>&1; then
-               TARGET=X86_64;
-             else
-               TARGET=X86;
-             fi
-             rm -f conftest.*
-             ;;
-          esac
+         echo 'int foo (void) { return __x86_64__; }' > conftest.c
+         if $CC $CFLAGS -Werror -S conftest.c -o conftest.s > /dev/null 2>&1; then
+           TARGET=X86_64;
+         else
+           TARGET=X86;
+          fi
+          rm -f conftest.*
        else
          TARGET=X86_64;
        fi