NetBSD Problem Report #60889
From www@netbsd.org Fri Oct 16 17:30:26 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 316C51A923C
for <gnats-bugs@gnats.NetBSD.org>; Fri, 16 Oct 2026 17:30:26 +0000 (UTC)
Message-Id: <20261016173024.D79071A923E@mollari.NetBSD.org>
Date: Fri, 16 Oct 2026 17:30:24 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: riscv64: compat_netbsd32 is busticated
X-Send-Pr-Version: www-1.0
X-From4GNATS: "campbell+netbsd@mumble.net via gnats" <gnats-admin@NetBSD.org>
>Number: 60889
>Category: port-riscv
>Synopsis: riscv64: compat_netbsd32 is busticated
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-riscv-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Oct 16 17:35:00 +0000 2026
>Last-Modified: Fri Oct 16 17:50:03 +0000 2026
>Originator: Taylor R Campbell
>Release: current
>Organization:
RiscvBSD 32 LLC (Limited Compatibility Company)
>Environment:
>Description:
/home/riastradh/netbsd/current/src/sys/compat/netbsd32/netbsd32_exec_aout.c: In function 'exec_netbsd32_makecmds':
/home/riastradh/netbsd/current/src/sys/compat/netbsd32/netbsd32_exec_aout.c:119:15: error: 'NETBSD32_MID_MACHINE' undeclared (first use in this function)
119 | case (NETBSD32_MID_MACHINE << 16) | ZMAGIC:
| ^~~~~~~~~~~~~~~~~~~~
>How-To-Repeat:
options COMPAT_NETBSD32
options EXEC_ELF32
>Fix:
>Audit-Trail:
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60889 CVS commit: src/sys/conf
Date: Fri, 16 Oct 2026 17:48:56 +0000
Module Name: src
Committed By: riastradh
Date: Fri Oct 16 17:48:56 UTC 2026
Modified Files:
src/sys/conf: files
Log Message:
sys/conf/files: riscv has no EXEC_AOUT either even for compat32.
Do the same ifdef dance as for mips and arm.
Fixes:
> /home/riastradh/netbsd/current/src/sys/compat/netbsd32/netbsd32_exec_aout.c: In function 'exec_netbsd32_makecmds':
> /home/riastradh/netbsd/current/src/sys/compat/netbsd32/netbsd32_exec_aout.c:119:15: error: 'NETBSD32_MID_MACHINE' undeclared (first use in this function)
> 119 | case (NETBSD32_MID_MACHINE << 16) | ZMAGIC:
> | ^~~~~~~~~~~~~~~~~~~~
PR port-riscv/60889: riscv64: compat_netbsd32 is busticated
To generate a diff of this commit:
cvs rdiff -u -r1.1324 -r1.1325 src/sys/conf/files
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60889 CVS commit: src/sys/arch/riscv
Date: Fri, 16 Oct 2026 17:49:12 +0000
Module Name: src
Committed By: riastradh
Date: Fri Oct 16 17:49:12 UTC 2026
Modified Files:
src/sys/arch/riscv/include: netbsd32_machdep.h
src/sys/arch/riscv/riscv: netbsd32_machdep.c
Log Message:
riscv: Make comapt32 compile.
Note: I doubt it will work -- cpu_getmcontext32 and cpu_setmcontext32
appear to be missing save/restore of most registers, so signal
delivery will probably trash them. Also not sure whether to use
l->l_private or tf->tf_reg[_REG_TP] here (or _X_TP). TBD!
PR port-riscv/60889: riscv64: compat_netbsd32 is busticated
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/include/netbsd32_machdep.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/riscv/netbsd32_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.