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

--- Comment #31 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot 
Uni-Bielefeld.DE> ---
> --- Comment #27 from Rainer Orth <ro at gcc dot gnu.org> ---
> Created attachment 63525
>   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63525&action=edit
> Revised patch
>
> I'd started testing this revised patch which does the suggested merge, only
> handling the *-*-darwin*:no (native as) case.
>
> Meanwhile I've started to wonder if we need to do something about other x86
> targets like
>
> * x86 non-gas: do they exist outside of Solaris/Darwin?
> * non-Linux/Solaris bi-arch x86 targets with gas
> * i?86 non-Linux/Solaris targets with 64-bit-default gas
>
> At least some of those cases would have been handled before my patch by the
> scattered explicit checks for --32/--64.
>
> I'll try to check if any of those exist.

I'm pretty sure now we need something like this.  A biarch
amd64-pc-freebsd15.0 build broke exactly as Linux/x86_64 did before.

I've come to the conclusion that we need two things (at least for now):

* Always set gas_flag/gnu_ld_flag so the checks in configure.ac and
  acinclude.m4 that *need* to know which set of assembler options or
  syntax to use will refer to those.

* config.gcc documents the following:

#  gas_flag             Either yes or no depending on whether GNU as was
#                       requested.
#  gnu_ld_flag          Either yes or no depending on whether GNU ld was
#                       requested.

#  gas                  Set to yes or no depending on whether the target
#                       system normally uses GNU as.
#  gnu_ld               Set to yes or no depending on whether the target
#                       system normally uses GNU ld.

  The gas/gnu_ld set can for the moment be used to set
  HAVE_GNU_AS/HAVE_GNU_LD where the `normally' part is ok.

  However, for those configure checks that need the correct value,
  that's not enough.  Instead, those cases should *always* use
  gas_flag/gnu_ld_flag and always determine the correct value for that.

My current idea is to ultimately have four patches:

* One patch that ensures that gas_flag/gnu_ld_flag are always set and
  match the assembler and linker used (gcc_cv_as/gcc_cv_ld).

* The next is a revised version of the attached one: it handles
  Darwin/as and Solaris/as separately and applies gas options
  (--32/--64/--x32) on all x86 *and sparc* targets that have been
  determined to use gas.

* As a follow-up (but certainly not so close to the GCC 16 release), we
  should get rid of gas/gnu_ld.  Right now they are used to define
  HAVE_GNU_AS/HAVE_GNU_LD, and I won't touch that ATM.  However, I don't
  see a point in the `system normally uses' part: why hardcode something
  like this if it can easily be determined at configure time from
  $gcc_cv_as/$gcc_cv_ld --version?  I may be totally wrong here, of
  course.

* And finally, when we can guarantee (we probably already can) that both
  gcc_cv_as and gcc_cv_ld are always set, all those checks if they are
  set, sprinkled all over configure.ac, can just go.

I've got the first two in testing now will attach them here once that
testing has passed.

I've already created the last two, too, but they are totally untested so
far and I won't spend time on them for now.

Reply via email to