On Wed, May 6, 2026 at 4:05 AM Rainer Orth <[email protected]>
wrote:
> When working to handle more vendor assemblers and linkers for the patch
> series described in
>
> [PATCH 0/6] Remove HAVE_GNU_{AS,LD} etc.
> https://gcc.gnu.org/pipermail/gcc-patches/2026-April/715161.html
>
> it turned out that the original plan to follow what I'd done for Solaris
> so far with the solaris_{as,ld} variables leads to code that is hard to
> understand.
>
> Therefore this patch uses a different approach: it introduces two new
> variables, as_flavor, and ld_flavor. They both default to gnu, i.e. the
> GNU Binutils toolchain or compatible assemblers and linkers.
>
> To deal with incompatible vendor toolchains, those variables can take
> other values. In addition to solaris, there are aix, darwin, hpux, and
> nvptx. More could be added as necessary.
>
> In preparation for the patch series above, this patch switches existing
> code from solaris_{as,ld} to {as,ld}_flavor=solaris.
>
> It also checks the configured assembler and linker for the vendor
> toolchains above. If there's a choice between native and GNU toolchains
> (AIX, HP-UX, Solaris), the as and ld version outputs are examined.
> Otherwise (Darwin, NVPTX), the values are hardcoded and only used in
> configure messages.
>
> In addition to {as,ld}_flavor, HAVE_<FLAVOR>_{AS,LD} macros are defined
> in cases they are actually needed, matching existing HAVE_SOLARIS_{AS,LD}.
>
> Tested together with a reworked version of the patch series above on
> x86_64-pc-linux-gnu, powerpc-ibm-aix7.3.1.0 (as/ld and gas/gld),
> x86_64-apple-darwin17.7.0, i386-pc-solaris2.11 and sparc-sun-solaris2.11
> (as/ld, gas/ld, and gas/gld). Also tested by Dave on HP-UX.
>
> For the time being, I've ignored VMS which would also need handling: the
> support status of VMS support in GCC is completely unknown, AFAIK there
> are no public build systems and there's no information on the targets in
> install.texi.
>
> Ok for trunk?
>
Okay.
Thanks for adjusting the design.
David
>
> Rainer
>
> --
>
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
>
>
> 2026-05-03 Rainer Orth <[email protected]>
>
> gcc:
> * acinclude.m4: Check as_flavor, ld_flavor instead of solaris_as,
> solaris_ld.
> * configure.ac: Likewise.
> (as_flavor, ld_flavor): New variables.
> Adapt messages.
> Set based on as, ld version output.
> (HAVE_AIX_AS): Define.
> * configure: Regenerate.
> * config.in: Regenerate.
>
>