On Mon, 18 Aug 2025 21:51:05 +0200,
Kirill A. Korinsky <[email protected]> wrote:
> 
> On Mon, 18 Aug 2025 20:53:57 +0200,
> Jeremie Courreges-Anglas <[email protected]> wrote:
> > 
> > > So, here a new version which the cleaner, and it also allow to move a bit
> > > forward with sparc64 build. Now it fails because our ld is crashed.
> > 
> > Woo hoo, congrats!  Did you get feedback on mips64?
> >
> 
> I'll send to bugs@ later that I do have with sparc64, probably it is bug on
> our end.
> 

After some thinking, not sure that bugs@ is right place so I let put it
here, and I always can send it to bugs@ anyway.

The first commit which I can't build on openbsd/sparc64 is
https://gcc.gnu.org/cgit/gcc/commit/?id=9b884225bfc609606f9b169b021c4da93feba48e

If I remove introduced condition

   if (!cmp_type || iv_precision > TYPE_PRECISION (cmp_type))

I can build it for the next few commits, until it explode again like this:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000000a31e861600 in _ZN4bidi7contextC1Ev+0xfffffffffb59ea0c@plt ()
(gdb) disassemble
Dump of assembler code for function _ZN4bidi7contextC1Ev+0xfffffffffb59ea0c@plt:
   0x000000a31e8615f0 <+0>:     mov  %o7, %g5
   0x000000a31e8615f4 <+4>:     call  0xa31e8615fc 
<_ZN4bidi7contextC1Ev+0xfffffffffb59ea0c@plt+12>
   0x000000a31e8615f8 <+8>:     nop 
   0x000000a31e8615fc <+12>:    ldx  [ %o7 + 0x65c ], %g1
=> 0x000000a31e861600 <+16>:    jmpl  %o7 + %g1, %g1
   0x000000a31e861604 <+20>:    mov  %g5, %o7
End of assembler dump.
(gdb) p/x $o7 + 0x65c
$1 = 0xa31e861c50
(gdb) x/x $o7 + 0x65c
0xa31e861c50 <[email protected]>:    0xf9e379e0
(gdb) p/x $o7 + $g1
$2 = 0xf9e37a841e6ff100
(gdb) x/x $o7 + $g1
0xf9e37a841e6ff100:     Cannot access memory at address 0xf9e37a841e6ff100
(gdb) x/x $g1
0xf9e379e0ffe9db0c:     Cannot access memory at address 0xf9e379e0ffe9db0c
(gdb) p/x $g1
$3 = 0xf9e379e0ffe9db0c
(gdb) 

different commits lead to a different place, but it always a code like this.

If I build the first compiler without PIE, by removing --enable-host-pie
from line 166, it leads to a crash like this:

/usr/local/bootstrap-gcc/bin/g++ -std=c++14  -fno-PIE -c  -DIN_GCC_FRONTEND -g 
-DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall 
-Wno-error=narrowing -Wwrite-strings -Wcast-qual -Wno-format 
-Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual 
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings  
-DHAVE_CONFIG_H -fno-PIE -I. -I. -I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc 
-I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/. 
-I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../include  
-I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libcpp/include 
-I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libcody -I/usr/local/include  
-I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libdecnumber 
-I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libdecnumber/dpd 
-I../libdecnumber -I/usr/ports/pobj/gcc-15.2.0/gcc-15.2.0/gcc/../libbacktrace   
-o cc1-checksum.o -MT cc1-checksum.o -MMD -MP -MF ./.deps/cc1-checksum.TPo 
cc1-checksum.cc
/usr/local/bootstrap-gcc/bin/g++ -std=c++14 -no-pie   -g -DIN_GCC    
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall 
-Wno-error=narrowing -Wwrite-strings -Wcast-qual -Wno-format 
-Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual 
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings  
-DHAVE_CONFIG_H -no-pie -static-libstdc++ -static-libgcc  -o cc1 c/c-lang.o 
c-family/stub-objc.o attribs.o c/c-errors.o c/c-decl.o c/c-typeck.o 
c/c-convert.o c/c-aux-info.o c/c-objc-common.o c/c-parser.o c/c-fold.o 
c/gimple-parser.o c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o 
c-family/c-format.o c-family/c-gimplify.o c-family/c-indentation.o 
c-family/c-lex.o c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o 
c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o 
c-family/c-semantics.o c-family/c-ada-spec.o c-family/c-ubsan.o 
c-family/known-headers.o c-family/c-attribs.o c-family/c-warn.o 
c-family/c-spellcheck.o c-family
 /c-type-mismatch.o sparc-c.o default-c.o \
  cc1-checksum.o simple-diagnostic-path.o lazy-diagnostic-path.o libbackend.a 
main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a 
../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a   
../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a 
../libdecnumber/libdecnumber.a   -L/usr/local/lib -lmpc -lmpfr -lgmp -rdynamic  
-lz 
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core 
dumped

with absolutle useless stacktrace inside core:

Core was generated by `ld.bfd'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00000099a352bb48 in bfd_putb64 ()
(gdb) bt
#0  0x00000099a352bb48 in bfd_putb64 ()
#1  0x00000099a3544fb8 in bfd_elf64_swap_reloca_out ()
#2  0x00000099a353e644 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

anyway, all of this smells like an issue in our ld.

-- 
wbr, Kirill

Reply via email to