NetBSD-Bugs archive

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

misc/39522: Turning on make's debugging info will change the building options



>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:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 12 02:35:00 +0000 2008
>Originator:     Gao Ya'nan
>Release:        NetBSD-current and NetBSD-4.0
>Organization:
>Environment:
NetBSD abutter.foo.org 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

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

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

When I used mybuild.sh 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:
===> mybuild.sh command: ./mybuild.sh -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:
===> mybuild.sh command: ./mybuild.sh -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
>How-To-Repeat:
Apply the patch below and run ./mybuild.sh -f p -O ../obj-x86/obj -T 
../obj-x86/tools -U -u tools

--- ./build.sh  2007-11-27 05:40:55.000000000 +0800
+++ ./mybuild.sh        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 @@
 
 parseoptions()
 {
-       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:'
        opt_a=no
 
        if type getopts >/dev/null 2>&1; then
@@ -588,6 +589,11 @@
                        do_expertmode=true
                        ;;
 
+               -f)
+                       eval ${optargcmd}
+                       debugflag="-d ${OPTARG}"
+                       ;;
+
                -i)
                        usage "'-i idir' has been replaced by 'install=idir'"
                        ;;
@@ -1003,17 +1009,17 @@
 buildtools()
 {
        if [ "${MKOBJDIRS}" != "no" ]; then
-               ${runcmd} "${makewrapper}" ${parallel} obj-tools ||
+               ${runcmd} "${makewrapper}" ${parallel} ${debugflag} obj-tools ||
                    bomb "Failed to make obj-tools"
        fi
        ${runcmd} cd tools
        if [ "${MKUPDATE}" = "no" ]; then
-               ${runcmd} "${makewrapper}" ${parallel} cleandir ||
+               ${runcmd} "${makewrapper}" ${parallel} ${debugflag} cleandir ||
                    bomb "Failed to make cleandir tools"
        fi
-       ${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)"
                KERNARCHDIR="$(getmakevar KERNARCHDIR)"
                ${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}"
        fi
@@ -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}"
        fi
@@ -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 @@
 
                sets)
                        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}"
                        ;;
 
                obj|build|distribution|release|sourcesets|syspkgs|params)
-                       ${runcmd} "${makewrapper}" ${parallel} ${op} ||
+                       ${runcmd} "${makewrapper}" ${parallel} ${debugflag} 
${op} ||
                            bomb "Failed to make ${op}"
                        statusmsg "Successful make ${op}"
                        ;;
 
                iso-image|iso-image-source)
-                       ${runcmd} "${makewrapper}" ${parallel} \
+                       ${runcmd} "${makewrapper}" ${parallel} ${debugflag} \
                            CDEXTRA=$iso_dir ${op} ||
                            bomb "Failed to make ${op}"
                        statusmsg "Successful make ${op}"

>Fix:
I didn't find it yet.



Home | Main Index | Thread Index | Old Index