NetBSD Problem Report #59992
From www@netbsd.org Tue Feb 10 09:39:12 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 "R13" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 94C9A1A923D
for <gnats-bugs@gnats.NetBSD.org>; Tue, 10 Feb 2026 09:39:12 +0000 (UTC)
Message-Id: <20260210093911.8BB141A923E@mollari.NetBSD.org>
Date: Tue, 10 Feb 2026 09:39:11 +0000 (UTC)
From: georg.kuehberger@at.bosch.com
Reply-To: georg.kuehberger@at.bosch.com
To: gnats-bugs@NetBSD.org
Subject: Built abort in kernel moduls for compileroption -g3
X-Send-Pr-Version: www-1.0
X-From4GNATS: "georg.kuehberger@at.bosch.com via gnats" <gnats-admin@NetBSD.org>
>Number: 59992
>Category: kern
>Synopsis: Built abort in kernel moduls for compileroption -g3
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Feb 10 09:40:00 +0000 2026
>Originator: Georg Kühberger
>Release: 10.1
>Organization:
Robert Bosch AG
>Environment:
Linux WI-C-003UC 6.14.0-37-generic #37~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 20 10:25:38 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
>Description:
Build aborts due to not matching debug flages -g vs. -g3 in bsd.kmodule.mk
See error:
# compile unlink/unlink.o
/home/kug83wi/scripts/netbsd/usr/src/../obj.chimaera7.amd64/tooldir/bin/x86_64--netbsd-gcc -g3 -fPIE -std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wsystem-headers -Wno-traditional -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-sign-compare -Wsign-compare -Wformat=2 -Wno-format-zero-length -Werror -D_KERNTYPES --sysroot=/home/kug83wi/scripts/netbsd/usr/src/../obj.chimaera7.amd64/destdir.amd64 -c /home/kug83wi/scripts/netbsd/usr/src/usr.sbin/unlink/unlink.c -o unlink.o.o
--- dependall-tests ---
k_helper.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
*** Failed target: k_helper.kmod
*** Failed commands:
${_MKTARGET_LINK}
=> @echo '# ' " link " k_helper/k_helper.kmod
${CC} ${LDFLAGS} -nostdlib -r -Wl,-T,${KMODSCRIPT},-d -Wl,-Map=${.TARGET}.map -o ${.TARGET} ${OBJS}
--- dependall-usr.sbin ---
>How-To-Repeat:
Run:
./build.sh -m amd64 -U -r -V "CFLAGS= -g3" -O ../obj.chimaera7.amd64/ -T ../obj.chimaera7.amd64/tooldir -j8 distribution
>Fix:
Patch that fixes the Problem:
>From 4af6bf54759a4f323bceecf95220fab4fd98a031 Mon Sep 17 00:00:00 2001
From: "Kuehberger Georg (XC-HWP/EEB4)" <Georg.Kuehberger@at.bosch.com>
Date: Thu, 11 Dec 2025 17:20:37 +0100
Subject: [PATCH] Fixed Build for -O0 -g3
---
share/mk/bsd.kmodule.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/share/mk/bsd.kmodule.mk b/share/mk/bsd.kmodule.mk
index a6a7a551160b..e781769905ca 100644
--- a/share/mk/bsd.kmodule.mk
+++ b/share/mk/bsd.kmodule.mk
@@ -6,7 +6,7 @@ MKPIE=no
.include <bsd.init.mk>
.include <bsd.klinks.mk>
-.if ${MKCTF:Uno} == "yes"
+.if ${MKCTF:Uno} == "yes" && empty(CFLAGS:M*-g3*)
CFLAGS+= -g
# Only need symbols for ctf, strip them after converting to CTF
CTFFLAGS= -L VERSION
--
2.43.0
(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.