NetBSD-Bugs archive

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

kern/59992: Built abort in kernel moduls for compileroption -g3



>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@localhost>
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



Home | Main Index | Thread Index | Old Index