On Sat, Dec 6, 2025 at 6:56 AM Andrew Randrianasulu
<randrianasulu%gmail.com@localhost> wrote:
>
> On Sat, Dec 6, 2025 at 5:57 AM Andrew Randrianasulu
> <randrianasulu%gmail.com@localhost> wrote:
> >
> > On Sat, Dec 6, 2025 at 4:35 AM Andrew Randrianasulu
> > <randrianasulu%gmail.com@localhost> wrote:
> > >
> > > On Fri, Dec 5, 2025 at 4:06 PM Valery Ushakov <uwe%stderr.spb.ru@localhost> wrote:
> > > >
> > > > On Fri, Dec 05, 2025 at 11:35:23 +0300, Andrew Randrianasulu wrote:
> > > >
> > > > > So, I am still trying to build things from slightly older pkgsrc tree,
> > > > > and Cmake 3.31.7 fails witch attached gzipped log, ending with illegal
> > > > > instruction.
> > > > >
> > > > > Qemu line:
> > > > > qemu-system-sparc -hda sparc-netbsd-15g-compressed.qcow2 -m 1536 -g
> > > > > 1024x768x24 -M SS-20 -smp 3 -accel tcg,thread=multi,tb-size=256
> > > > >
> > > > > qemu --version:
> > > > > qemu-system-sparc --version
> > > > > QEMU emulator version 9.1.50 (v9.1.0-1687-gf0cfd06786-dirty)
> > > > > Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers
> > > > >
> > > > > Note that this configuration survived gnutls , libbluray,
> > > > > libtheora-1.2.0 builds
> > > > > so generally it works ?
> > >
> > > even installing pre-build pkg by Vom513 still gives illegal instruction
> > >
> > > https://mastodon.online/@Andrew_R/115670749252048951
> > >
> > > _atomic_fetch_add_4 in /usr/pkg/lib/libatomic.so.3 ..
>
>
> 0xede93374 in __atomic_fetch_add_4 () from /usr/pkg/lib/libatomic.so.3
> (gdb) disassemble /s __atomic_fetch_add_4
> Dump of assembler code for function __atomic_fetch_add_4:
> 0xede9335c <+0>: save %sp, -96, %sp
> 0xede93360 <+4>: mov %i0, %g2
> 0xede93364 <+8>: ld [ %i0 ], %g1
> 0xede93368 <+12>: unknown
> 0xede9336c <+16>: mov %g1, %i0
> 0xede93370 <+20>: add %g1, %i1, %g3
> => 0xede93374 <+24>: casa [ %g2 ] #ASI_P, %g1, %g3
> 0xede93378 <+28>: unknown
> 0xede9337c <+32>: cmp %g3, %i0
> 0xede93380 <+36>: unknown
> 0xede93384 <+40>: mov %g3, %g1
> 0xede93388 <+44>: rett %i7 + 8
> 0xede9338c <+48>: nop
> End of assembler dump.
ow, it was /sr
(gdb) disassemble /sr __atomic_fetch_add_4
Dump of assembler code for function __atomic_fetch_add_4:
0xede9335c <+0>: 9d e3 bf a0 save %sp, -96, %sp
0xede93360 <+4>: 84 10 00 18 mov %i0, %g2
0xede93364 <+8>: c2 06 00 00 ld [ %i0 ], %g1
0xede93368 <+12>: 81 43 e0 0f unknown
0xede9336c <+16>: b0 10 00 01 mov %g1, %i0
0xede93370 <+20>: 86 00 40 19 add %g1, %i1, %g3
=> 0xede93374 <+24>: c7 e0 90 01 casa [ %g2 ] #ASI_P, %g1, %g3
0xede93378 <+28>: 81 43 e0 0f unknown
0xede9337c <+32>: 80 a0 c0 18 cmp %g3, %i0
0xede93380 <+36>: 12 47 ff fa unknown
0xede93384 <+40>: 82 10 00 03 mov %g3, %g1
0xede93388 <+44>: 81 cf e0 08 rett %i7 + 8
0xede9338c <+48>: 01 00 00 00 nop
End of assembler dump.
still hm.
but this affects qemu-sparc userspace emulator? (so Linux-on-linux)
strange, there was talk on Linux/glibc side of things about emulating those CAS (compare and swap) instructions, but not sure if 32bit part was ever written ... (considering Linux aggressively remove "obsoleted" arches.
Not sure if NetBSD does something special on real hardware ... Because there evidently it works.
probably 32bit host for qemu introduces this somehow, but I yet to verify this ....