NetBSD-Bugs archive

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

bin/38044: netbsd-4 won't build cleanly with -DLOCKDEBUG



>Number:         38044
>Category:       bin
>Synopsis:       netbsd-4 won't build cleanly with -DLOCKDEBUG
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 16 21:20:00 +0000 2008
>Originator:     Greg A. Woods
>Release:        NetBSD 4.0_STABLE 2008/02/15
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD 4.0_STABLE GENERIC.MP
Architecture: i386
Machine: i386
>Description:

        netbsd-4 won't build cleanly with -DLOCKDEBUG

        Note that to build a complete working production-usable system
        that can also support LOCKDEBUG kernels then effectively the
        whole of user-land, except now for usr.bin/pmap, must also be
        built with LOCKDEBUG set.  This was true in 1.6, and is still
        apparently true in 4.0.

>How-To-Repeat:

        add "CFLAGS += -DLOCKDEBUG" to mk.conf and rebuild, seeing:

/rest/work/woods/m-NetBSD-4/usr.bin/pmap/main.c:62:1: error: "LOCKDEBUG" 
redefined
<command line>:1:1: error: this is the location of the previous definition

        actually you don't likely want -DLOCKDEBUG for your "INSTALL"
        kernel either since that chews up too much space unnecessarily
        so the mk.conf segment I use is actually more like:

.if defined(NETBSDSRCDIR)
# NOTE: these expressions cannot be combined because the : modifier
# seems to be evaluated first and it fails if the variable is not
# defined
. if ${NETBSDSRCDIR:T} == "m-NetBSD-4" && ${PWD:T} != "INSTALL"
CFLAGS +=       -DLOCKDEBUG
. endif
.endif


>Fix:

        This is a bit of a hack, but then again so is the rather poor
        way the code currently assumes that LOCKDEBUG won't be set on
        the command line.

        A better fix would be to correct the code such that it ignored
        any command-line definition of LOCKDEBUG.

        (and an even better fix would be to modify all the rest of
        userland that ever could encounter kernel data objects which
        change size when LOCKDBUG is used such that it could always
        determine empirically from the data itself whether or not the
        kernel had been compiled with LOCKDEBUG and thus always be able
        to interpret the kernel data correctly)

Index: Makefile
===================================================================
RCS file: /cvs/master/m-NetBSD/main/src/usr.bin/pmap/Makefile,v
retrieving revision 1.2
diff -u -c -r1.2 Makefile
cvs diff: conflicting specifications of output style
*** Makefile    8 Jan 2003 20:25:12 -0000       1.2
--- Makefile    16 Feb 2008 20:57:35 -0000
***************
*** 8,10 ****
--- 8,12 ----
  DPADD=                ${LIBKVM}
  
  .include <bsd.prog.mk>
+ 
+ CFLAGS:=      ${CFLAGS:S/-DLOCKDEBUG//}



Home | Main Index | Thread Index | Old Index