Hi Alex,
> On Feb 3, 2026, Rainer Orth <[email protected]> wrote:
>
>> Maybe it would be better to use gas options irrespective of whether the
>> assembler self-identifies as gas at this point?
>
> I guess configure tests in the autoconf tradition of checking for
> features, rather than for versions, would be better served by extending
> the rationale to not relying on provenance either, with the caveat that
> when we're building the compiler along with binutils we can't
> configure-test the not-yet-built assembler.
I believe the in-tree cases are already handled separately, but for the
rest I fully agree: I've seen several cases so far where the as/ld
--version checks produce incorrect results. In particular old versions
of Darwin as are ports of gas 1.38 and identify as such, but don't
accept the gas --32 etc. options. Similarly, many linkers accept GNU
ld's -m <emulation> options although they don't identify as GNU.
We are dealing with two different questions here:
* Does the assembler/linker in question accept the GNU options?
* Does it accept gas assembler syntax or provide gld features.
I guess mid-term we need to audit both
* uses of gas/gas_flag/gnu_ld/gnu_ld flag in configure.ac and
acinclude.m4 to determine what is actually checked for, and
* likewise, uses of HAVE_GNU_AS and HAVE_GNU_LD
to unravel this maze/mess.
Currently we don't even verify that e.g. the assembler and linker flags
determined are actually understood by the tools in question, leading to
feature tests failing not because the tool lacks the feature but because
it doesn't support some option.
> That kind of change should probably wait for stage1 though...
Absolutely: I've caused enough breakage so far ;-(
>> Or just commit as is and wait if there's yet more fallout so we know
>> for certain?
>
> ... so I recommend going ahead with the more conservative changes at
> this point.
Right: I'll use gas/gld options unless we can determine they won't work
(Solaris and Darwin native tools). I've updated my patch and comments
accordingly, will run another round of checks and bootstraps, and
re-post/commit afterwards.
Thanks.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University