https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123841

--- Comment #22 from Iain Sandoe <iains at gcc dot gnu.org> ---
> > --- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> > Ah, then yeah, we should reopen and go with a safer variant, i.e.
> >   i?86-*-solaris2*:* | x86_64-*-solaris2*:* | i?86-*-linux*:* |
> > x86_64-*-linux*:* )
> > So, basically go back to what the code was doing before, except for solaris.
> 
> That's an option, but the patch I'm currently testing goes the other way
> round, matching what Solaris does.  This avoids the fact that Darwin as
> creates 64-bit objects by default all the way back to macOS 10.7, even
> for a 32-bit-default build.

It defaults to the object size of the kernel, I believe - so that
(for example) on 10.5 running on a 64b processor, it still defaults to
i386 / 32b even tho the machine supports a 64b multilib.

>  This may or may not make a difference to
> what happens without any options passed to as, but it seems more correct
> to me.  I'll report my findings and let Iain decide what he prefers.

I suspect that for configure queries that are testing if the assembler
supports a given directive or command line option, it would make no
difference. (i.e. the assembler will support them evenly between 32 and
64b).

I don't think that we currently make configure queries that would poke
at arch-specific support, but ICBW.

> We could still restrict setting gcc_cv_as_flags etc. to Solaris/x86 with
> gas and Linux if we like.
> 
> diff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4
> --- a/gcc/acinclude.m4
> +++ b/gcc/acinclude.m4
> @@ -478,7 +478,21 @@ AC_DEFUN([gcc_GAS_FLAGS],
>      as_32_opt=-m32
>      as_64_opt=-m64
>      ;;
> -  i?86-*-*:* | x86_64-*-*:* )
> +  i?86-*-darwin*:no | x86_64-*-darwin*:no)
> +    dnl The native Darwin assembler needs different options and creates
> +    dnl 64-bit objects by default.
> +    case "$target" in
> +      i?86-*-*)
> +        gcc_cv_as_flags="-arch i386"
> +        ;;
> +      x86_64-*-*)
> +        gcc_cv_as_flags="-arch x86_64"
> +        ;;
> +    esac
> +    as_32_opt="-arch i386"
> +    as_64_opt="-arch x86_64"
> +    ;;
> +  i?86-*-*:* | x86_64-*-*:*)
>      dnl Override the default, which may be incompatible.
>      case "$target" in
>        i?86-*-*)

This is probably safer, for the sake of a few extra lines.

Reply via email to