public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>,
	Jakub Jelinek <jakub@redhat.com>,
	 Jeff Law <jeffreyalaw@gmail.com>
Subject: Re: [PATCH] libffi/x86: Always check __x86_64__ for x86 hosts
Date: Fri, 9 Jul 2021 09:31:04 -0700	[thread overview]
Message-ID: <CAMe9rOrbL1AxX26gvwWG0evpkK9q044UrtaprLJehnZnUoE95w@mail.gmail.com> (raw)
In-Reply-To: <20210706010017.1922065-1-hjl.tools@gmail.com>

On Mon, Jul 5, 2021 at 6:00 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> 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 | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)
>
> diff --git a/libffi/configure.host b/libffi/configure.host
> index 786b32c5bb0..7248acb7458 100644
> --- a/libffi/configure.host
> +++ b/libffi/configure.host
> @@ -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
> --
> 2.31.1
>

This has been fixed in upstream with

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.

I will check it in if there are no objections.

-- 
H.J.

      reply	other threads:[~2021-07-09 16:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06  1:00 H.J. Lu
2021-07-09 16:31 ` H.J. Lu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMe9rOrbL1AxX26gvwWG0evpkK9q044UrtaprLJehnZnUoE95w@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jeffreyalaw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).