pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/60875: open-simh: miscompiled by GCC on NetBSD/amd64



>Number:         60875
>Category:       pkg
>Synopsis:       open-simh: miscompiled by GCC on NetBSD/amd64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 14 10:05:00 +0000 2026
>Originator:     Rin Okuyama
>Release:        11.99.9 and 2026Q3
>Organization:
Internet Initiative Japan Inc.
>Environment:
NetBSD sakaizumii.local 11.99.9 NetBSD 11.99.9 (AMD64_NET_MPSAFE) #2: Sat Oct 10 17:06:17 JST 2026  rin@sakaizumii.local:/home/rin/src/sys/arch/amd64/compile/AMD64_NET_MPSAFE amd64
>Description:
For open-simh-4.1.0.20260413nb2 on NetBSD/amd64-current, "normal
system test 31" fails:

```
% simh-vax NetBSD-11.99.9-vax-live.boot

MicroVAX 3900 simulator Open SIMH V4.1-0 Current        simh git commit id: 7994e0a7        Build: Unsupported=include+lib
/old/home/rin/vax/NetBSD-11.99.9-vax-live.boot-9> attach xq tap:tap0
%SIM-INFO: Eth: opened OS device tap0


KA655X-B V5.3, VMB 2.7
Performing normal system tests.
40..39..38..37..36..35..34..33..32..31..

?53 2 07 FF 00 0000

P1=00000002  P2=00000028  P3=00000000  P4=00D40077  P5=00000000
P6=FFFFFFFF  P7=00000000  P8=00000000  P9=00000000 P10=20051CE0
r0=A380D3C6  r1=20140110  r2=A380D3C7  r3=00000000  r4=A380D3D1
r5=2004E8F9  r6=000F4240  r7=80000011  r8=00000000 ERF=80000000
30..29..28..27..26..25..
24..23..22..21..20..19..18..17..16..15..14..13..12..11..10..09..
08..07..06..05..04..03..
Normal operation not possible.

>>>
```

I'm using this config file:

```
load -r ka655x.bin
set cpu 256m
set cpu idle=netbsd
set rq0 ra92
at rq0 NetBSD-11.99.9-vax-live.img
attach xq tap:tap0
boot cpu
```

and ka655x.bin acquired from here:
https://github.com/simh/simh/blob/master/VAX/ka655x.bin

This failure happens with GCC 10.5 (from netbsd-10 branch), 12.5,
and 14.4.

In order to work around, compile open-simh with -O3 or -O1 on
NetBSD/amd64. I've confirmed that full ATF run of NetBSD/vax on
-O3 compiled open-simh successfully completes with GCC 10.5, 12.5,
and 14.4.

I haven't tested emulators other than simh-vax on the other hand.
>How-To-Repeat:
Described above.
>Fix:
diff --git a/emulators/open-simh/Makefile b/emulators/open-simh/Makefile
index 857d0db21ced..3f18d6ed4f38 100644
--- a/emulators/open-simh/Makefile
+++ b/emulators/open-simh/Makefile
@@ -2,7 +2,7 @@
 
 DISTNAME=	open-simh-4.1.0
 PKGNAME=	open-simh-4.1.0.20260413
-PKGREVISION=	2
+PKGREVISION=	3
 CATEGORIES=	emulators
 MASTER_SITES=	${MASTER_SITE_GITHUB:=open-simh/}
 GITHUB_PROJECT=	simh
diff --git a/emulators/open-simh/hacks.mk b/emulators/open-simh/hacks.mk
new file mode 100644
index 000000000000..b972dc59cfe2
--- /dev/null
+++ b/emulators/open-simh/hacks.mk
@@ -0,0 +1,14 @@
+# $NetBSD$
+
+.if !defined(OPEN_SIMH_HACKS_MK)
+OPEN_SIMH_HACKS_MK=	defined
+
+.include "../../mk/compiler.mk"
+
+# For simh-vax, "normal system tests 31" fails.
+.if ${MACHINE_PLATFORM:MNetBSD-*-x86_64} && ${CC_VERSION:Mgcc-*}
+PKG_HACKS+=		optimisation
+BUILDLINK_TRANSFORM+=	opt:-O2:-O3
+.endif
+
+.endif	# OPEN_SIMH_HACKS_MK




Home | Main Index | Thread Index | Old Index