Two LTO tests FAIL on 64-bit Solaris/SPARC:

FAIL: gcc.dg/lto/toplevel-extended-asm-1 
c_lto_toplevel-extended-asm-1_0.o-c_lto_toplevel-extended-asm-1_1.o link, -O2 
-flto -flto-partition=1to1 -no-pie
FAIL: gcc.dg/lto/toplevel-simple-asm-1 
c_lto_toplevel-simple-asm-1_0.o-c_lto_toplevel-simple-asm-1_1.o link, -O2 -flto 
-flto-toplevel-asm-heuristics -flto-partition=1to1 -no-pie
FAIL: gcc.dg/lto/toplevel-simple-asm-1 
c_lto_toplevel-simple-asm-1_0.o-c_lto_toplevel-simple-asm-1_1.o link, -O2 -flto 
-flto-toplevel-asm-heuristics -flto-partition=cache -no-pie
FAIL: gcc.dg/lto/toplevel-simple-asm-1 
c_lto_toplevel-simple-asm-1_0.o-c_lto_toplevel-simple-asm-1_1.o link, -O2 -flto 
-flto-toplevel-asm-heuristics -flto-partition=max -no-pie

They always fail to link like

ld: fatal: relocation error: R_SPARC_32: file 
c_lto_toplevel-extended-asm-1_1.o: symbol .text (section): value 0x100001340 
does not fit

The same error has been present with gld all along, but was only
recently introduced in Solaris ld as discussed in binutils PR ld/25802.
It doesn't occur on Linux/sparc64 which uses a different text start
address.

Tested on sparcv9-sun-solaris2.11, sparc64-unknown-linux-gnu, and
x86_64-pc-linux-gnu.

Committed to trunk.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2026-06-13  Rainer Orth  <[email protected]>

        gcc/testsuite:
        * gcc.dg/lto/toplevel-extended-asm-1_0.c: Skip on 64-bit
        Solaris/SPARC.
        * gcc.dg/lto/toplevel-simple-asm-1_0.c: Likewise.

# HG changeset patch
# Parent  08db92d5ed42e168aedb3538c2ca8f6900ad9dc2
testsuite: xfail gcc.dg/lto/toplevel-extended-asm-1 etc. on 64-bit Solaris/SPARC

diff --git a/gcc/testsuite/gcc.dg/lto/toplevel-extended-asm-1_0.c b/gcc/testsuite/gcc.dg/lto/toplevel-extended-asm-1_0.c
--- a/gcc/testsuite/gcc.dg/lto/toplevel-extended-asm-1_0.c
+++ b/gcc/testsuite/gcc.dg/lto/toplevel-extended-asm-1_0.c
@@ -1,5 +1,6 @@
 /* { dg-lto-do link } */
 /* { dg-lto-options {{-O2 -flto -flto-partition=1to1 -no-pie} } } */
+/* { dg-skip-if "SPARC relocation overflow" { sparc*-*-solaris2* && lp64 } } */
 
 void asm_fn();
 void asm_fn_used();
diff --git a/gcc/testsuite/gcc.dg/lto/toplevel-simple-asm-1_0.c b/gcc/testsuite/gcc.dg/lto/toplevel-simple-asm-1_0.c
--- a/gcc/testsuite/gcc.dg/lto/toplevel-simple-asm-1_0.c
+++ b/gcc/testsuite/gcc.dg/lto/toplevel-simple-asm-1_0.c
@@ -1,5 +1,6 @@
 /* { dg-lto-do link } */
 /* { dg-lto-options { {-O2 -flto -flto-toplevel-asm-heuristics -flto-partition=1to1 -no-pie} {-O2 -flto -flto-toplevel-asm-heuristics -flto-partition=max -no-pie} {-O2 -flto -flto-toplevel-asm-heuristics -flto-partition=cache -no-pie}} } */
+/* { dg-skip-if "SPARC relocation overflow" { sparc*-*-solaris2* && lp64 } } */
 
 void asm_fn();
 void asm_fn_used();

Reply via email to