NetBSD Problem Report #39522

From  Fri Sep 12 02:33:01 2008
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id ADF6863B92A
	for <>; Fri, 12 Sep 2008 02:33:01 +0000 (UTC)
Message-Id: <>
Date: Fri, 12 Sep 2008 02:33:01 +0000 (UTC)
Subject: Turning on make's debugging info will change the building options
X-Send-Pr-Version: www-1.0

>Number:         39522
>Category:       misc
>Synopsis:       Turning on make's debugging info will change the building options
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 12 02:35:00 +0000 2008
>Last-Modified:  Fri May 19 20:14:31 +0000 2023
>Originator:     Gao Ya'nan
>Release:        NetBSD-current and NetBSD-4.0
NetBSD 4.0 NetBSD 4.0 (GENERIC) #0: Sun Dec 16 00:20:10 PST 2007  builds@wb34:/home/builds/ab/netbsd-4-0-RELEASE/i386/200712160005Z-obj/home/builds/ab/netbsd-4-0-RELEASE/src/sys/arch/i386/compile/GENERIC i386

As a newbie on BSD make, I turn on the make's debugging info to get what happend. 

so I copied to and added some code to send the debugging flag to make.

When I used to make tools, some error occured. I checked the output and found that make lost some options.

The good and bad ones are below:

The good one:
===> command: ./ -O ../obj-x86/obj -T ../obj-x86/tools -U -u tools kernel=GENERIC

#    create  binstall/xinstall.d
/usr/src/../obj-x86/tools/bin/nbhost-mkdep -f xinstall.d --     -I/usr/src/../obj-x86/obj/tools/compat -I/usr/src/../obj-x86/obj/tools/compat/include  -I/usr/src/tools/binstall/../compat -DHAVE_NBTOOL_CONFIG_H=1  -D_FILE_OFFSET_BITS=64  -I/usr/src/tools/binstall/../compat/sys -DTARGET_STRIP=\"/usr/src/../obj-x86/tools/bin/i386--netbsdelf-strip\" -I/usr/src/bin/ls -I/usr/src/usr.sbin/mtree  /usr/src/tools/binstall/../../usr.bin/xinstall/xinstall.c


Turn on the debugging info:
===> command: ./ -f p -O ../obj-x86/obj -T ../obj-x86/tools -U -u tools kernel=GENERIC

#    create  binstall/xinstall.d
/usr/src/../obj-x86/tools/bin/nbhost-mkdep -f xinstall.d --       -I/usr/src/tools/binstall/../compat/sys -DTARGET_STRIP=\"/usr/src/../obj-x86/tools/bin/i386--netbsdelf-strip\" -I/usr/src/bin/ls -I/usr/src/usr.sbin/mtree  /usr/src/tools/binstall/../../usr.bin/xinstall/xinstall.c
In file included from /usr/src/tools/binstall/../../usr.bin/xinstall/xinstall.c:75:
/usr/src/tools/binstall/../compat/sys/sha1.h:4:27: error: nbtool_config.h: No such file or directory

So I think turning on make's debugging info will change the building options
Apply the patch below and run ./ -f p -O ../obj-x86/obj -T ../obj-x86/tools -U -u tools

--- ./	2007-11-27 05:40:55.000000000 +0800
+++ ./	2008-01-07 20:43:49.000000000 +0800
@@ -492,6 +492,7 @@
     -E          Set "expert" mode; disables various safety checks.
                 Should not be used without expert knowledge of the build system.
     -h          Print this help message.
+    -f flag     Send debugging flag to make; see make(1) -d.
     -j njob     Run up to njob jobs in parallel; see make(1) -j.
     -M obj      Set obj root directory to obj; sets MAKEOBJDIRPREFIX.
                 Unsets MAKEOBJDIR.
@@ -526,7 +527,7 @@

-	opts='a:B:bC:D:dEhi:j:k:M:m:N:nO:oR:rT:tUuV:w:xX:Z:'
+	opts='a:B:bC:D:dEf:hi:j:k:M:m:N:nO:oR:rT:tUuV:w:xX:Z:'

 	if type getopts >/dev/null 2>&1; then
@@ -588,6 +589,11 @@

+		-f)
+			eval ${optargcmd}
+			debugflag="-d ${OPTARG}"
+			;;
 			usage "'-i idir' has been replaced by 'install=idir'"
@@ -1003,17 +1009,17 @@
 	if [ "${MKOBJDIRS}" != "no" ]; then
-		${runcmd} "${makewrapper}" ${parallel} obj-tools ||
+		${runcmd} "${makewrapper}" ${parallel} ${debugflag} obj-tools ||
 		    bomb "Failed to make obj-tools"
 	${runcmd} cd tools
 	if [ "${MKUPDATE}" = "no" ]; then
-		${runcmd} "${makewrapper}" ${parallel} cleandir ||
+		${runcmd} "${makewrapper}" ${parallel} ${debugflag} cleandir ||
 		    bomb "Failed to make cleandir tools"
-	${runcmd} "${makewrapper}" ${parallel} dependall ||
+	${runcmd} "${makewrapper}" ${parallel} ${debugflag} dependall ||
 	    bomb "Failed to make dependall tools"
-	${runcmd} "${makewrapper}" ${parallel} install ||
+	${runcmd} "${makewrapper}" ${parallel} ${debugflag} install ||
 	    bomb "Failed to make install tools"
 	statusmsg "Tools built to ${TOOLDIR}"
 	${runcmd} cd "${TOP}"
@@ -1030,7 +1036,7 @@
 		KERNSRCDIR="$(getmakevar KERNSRCDIR)"
 		${runcmd} cd "${KERNSRCDIR}/${KERNARCHDIR}/compile"
-		${runcmd} "${makewrapper}" ${parallel} obj ||
+		${runcmd} "${makewrapper}" ${parallel} ${debugflag} obj ||
 		    bomb "Failed to make obj in ${KERNSRCDIR}/${KERNARCHDIR}/compile"
 		${runcmd} cd "${TOP}"
@@ -1068,7 +1074,7 @@
 	    bomb "Cannot mkdir: ${kernelbuildpath}"
 	if [ "${MKUPDATE}" = "no" ]; then
 		${runcmd} cd "${kernelbuildpath}"
-		${runcmd} "${makewrapper}" ${parallel} cleandir ||
+		${runcmd} "${makewrapper}" ${parallel} ${debugflag} cleandir ||
 		    bomb "Failed to make cleandir in ${kernelbuildpath}"
 		${runcmd} cd "${TOP}"
@@ -1076,9 +1082,9 @@
 		-s "${TOP}/sys" "${kernelconfpath}" ||
 	    bomb "${toolprefix}config failed for ${kernelconf}"
 	${runcmd} cd "${kernelbuildpath}"
-	${runcmd} "${makewrapper}" ${parallel} depend ||
+	${runcmd} "${makewrapper}" ${parallel} ${debugflag} depend ||
 	    bomb "Failed to make depend in ${kernelbuildpath}"
-	${runcmd} "${makewrapper}" ${parallel} all ||
+	${runcmd} "${makewrapper}" ${parallel} ${debugflag} all ||
 	    bomb "Failed to make all in ${kernelbuildpath}"
 	${runcmd} cd "${TOP}"

@@ -1150,19 +1156,19 @@

 			statusmsg "Building sets from pre-populated ${DESTDIR}"
-			${runcmd} "${makewrapper}" ${parallel} ${op} ||
+			${runcmd} "${makewrapper}" ${parallel} ${debugflag} ${op} ||
 			    bomb "Failed to make ${op}"
 			statusmsg "Successful make ${op}"

-			${runcmd} "${makewrapper}" ${parallel} ${op} ||
+			${runcmd} "${makewrapper}" ${parallel} ${debugflag} ${op} ||
 			    bomb "Failed to make ${op}"
 			statusmsg "Successful make ${op}"

-			${runcmd} "${makewrapper}" ${parallel} \
+			${runcmd} "${makewrapper}" ${parallel} ${debugflag} \
 			    CDEXTRA=$iso_dir ${op} ||
 			    bomb "Failed to make ${op}"
 			statusmsg "Successful make ${op}"

I didn't find it yet.



State-Changed-From-To: open->feedback
State-Changed-When: Fri, 19 May 2023 20:14:31 +0000
I modified a local copy of so that the makewrapper
invoked make with "-d p", and successfuly used tools
(with a 48 MiB build log, versus 134 KiB build log without -d p).

I'm not convinced that we need another option to to pass
through debug options to make; just use to create makewrapper
and invoke that wrapper with the appropriate options and make targets.

Back to the ticket's original bug; do you experience build problems
when you have enabled make -d p, building -current?


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: gnats-precook-prs,v 1.4 2018/12/21 14:20:20 maya Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.