]> git.ipfire.org Git - thirdparty/gcc.git/commit
Default to -mcpu=ultrasparc3 on Solaris/SPARC
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 23 Jul 2025 07:18:58 +0000 (09:18 +0200)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 23 Jul 2025 07:18:58 +0000 (09:18 +0200)
commit6293da9e990f12202d3d84b2cd776436abe10860
tree2c6eda94aed720b503294bb931553eede2e795ae
parent9a8d91219d65f7cb304b1d678957f95061bfe02b
Default to -mcpu=ultrasparc3 on Solaris/SPARC

Prompted by the discussions around a recent clang bug, I realized that
gcc still defaults to -mcpu=v9 on Solaris/SPARC.

This is an oversight since the Oracle Studio 12.6 cc, released in 2017,
already defaults to -xarch=sparcvis2, the equivalent of
-mcpu=ultrasparc3.  Besides, both the 32 and 64-bit libc.so.1 require
UltraSPARC III extensions anyway:

      SPARC32PLUS Version 1, V8+ Required, UltraSPARC3 Extensions Required [VIS]
      SPARCV9 Version 1, UltraSPARC3 Extensions Required [VIS]

So this patch follows suite.

Bootstrapped on sparc-sun-solaris2.11 and sparcv9-sun-solaris2.11 with
as/ld, gas/ld, and gas/gld configurations.

There are currently two regressions exposed by this patch (PRs 121191
and 121192), which are only present in gcc 16 resp. 15/16.

There's one small caveat: while Solaris now marks all objects with
EF_SPARC_32PLUS EF_SPARC_SUN_US1 EF_SPARC_SUN_US3, gas only sets the
EF_SPARC_SUN_US[13] flags in the ELF header if UltraSPARC I/III insns
are actually used.  This is in accordance with the SPARC Compliance
Definition 2.4.1, 4P-1.  In the end, it doesn't matter anyway since
libc.so.1 already has both flags, so the resulting executables and
shared objects will too, anyway.

2025-07-20  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
* config.gcc <sparc*-*-solaris2*> (with_cpu): Default to ultrasparc3.
gcc/config.gcc