[PATCH] ld: testsuite: Fix several CTF tests on 32-bit SPARC
Jose E. Marchesi
jose.marchesi@oracle.com
Mon Jul 28 22:36:03 GMT 2025
> Hi Jose,
>
>>> Several ld CTF tests FAIL on 32-bit SPARC, e.g.
>>>
>>> FAIL: Arrays (conflicted)
>>>
>>> The failure mode is always the same:
>>>
>>> ./tmpdir/array-char-conflicting-1.s: Assembler messages:
>>> ./tmpdir/array-char-conflicting-1.s:89: Error: Architecture mismatch on "return %i7+8".
>>> ./tmpdir/array-char-conflicting-1.s:89: (Requires
>>> v9|v9a|v9b|v9c|v9d|v9e|v9v|v9m|m8; requested architecture is
>>> sparclite.)
>>>
>>> The problem is that gcc emits v8plus code by default, and thus invokes
>>> as with -xarch=v8plus (equivalent to -Av8plus), while the testcase lacks
>>> the latter.
>>>
>>> Fixed by setting ASFLAGS to match.
>>>
>>> Alternatively, one could use -Av9 which is already done for sparc-*-* in
>>> a couple of other cases.
>>
>> I wonder if it would be preferable to get the assembler to bump to
>> v8plus in sparc-* targets when it sees a v9 instruction...
>
> I fear that would be counterproductive:
>
> * For one, Solaris as behaves the same with -xarch=v8 (but has a
> -xarch=v8plus default since Solaris 11 requires an ultrasparc3 CPU):
>
> $ /bin/as -m32 -xarch=v8 v8+.s -o v8+.o
> /bin/as: "v8+.s", line 1: error: cannot use v8plus instructions in a non-v8plus target binary
>
> * But foremost, Linux/sparc still supports pre-V9 CPUs AFAIK, so such a
> silent bump would create code that cannot execute. They still default
> to -mv8/-Av8 after all.
Yeah I agree.
More information about the Binutils
mailing list