Subject: kern/29977: build fails if PGALLOC_VERBOSE is defined
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <sakurai@bug.co.jp>
List: netbsd-bugs
Date: 04/15/2005 04:49:00
>Number: 29977
>Category: kern
>Synopsis: build fails if PGALLOC_VERBOSE is defined
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Apr 15 04:49:00 +0000 2005
>Originator: sakurai@bug.co.jp
>Release: NetBSD 2.0.1
>Organization:
>Environment:
System: NetBSD spitz.bug.co.jp 2.0.1 NetBSD 2.0.1 (GENERIC) #1: Wed Mar 23 15:11:59 JST 2005 sakurai@spitz.bug.co.jp:/home/sakurai/sys/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
uvm_pglist.c cannot be compiled if PGALLOC_VERBOSE is defined.
I'm compiling 2.0.2 and current seems to have the same bug.
----- <output of ./bulid.sh> ------
# compile ESPT2/uvm_pglist.o
/home/sakurai/tmp/nb20/src/obj/tooldir.NetBSD-2.0.1-i386/bin/sh--netbsdelf-gcc -ffreestanding -O1 -Wno-parentheses -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -fno-zero-initialized-in-bss -Devbsh3 -I. -I/home/sakurai/tmp/nb20/src/sys/arch -I/home/sakurai/tmp/nb20/src/sys -nostdinc -DSH7710 -DHZ=50 -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -c /home/sakurai/tmp/nb20/src/sys/uvm/uvm_pglist.c
/home/sakurai/tmp/nb20/src/sys/uvm/uvm_pglist.c:284:73: macro "TAILQ_LAST" requires 2 arguments, but only 1 given
/home/sakurai/tmp/nb20/src/sys/uvm/uvm_pglist.c: In function `uvm_pglistalloc_contig':
/home/sakurai/tmp/nb20/src/sys/uvm/uvm_pglist.c:284: error: `TAILQ_LAST' undeclared (first use in this function)
/home/sakurai/tmp/nb20/src/sys/uvm/uvm_pglist.c:284: error: (Each undeclared identifier is reported only once
/home/sakurai/tmp/nb20/src/sys/uvm/uvm_pglist.c:284: error: for each function it appears in.)
*** Failed target: uvm_pglist.o
*** Failed command: echo '# ' "compile ESPT2/uvm_pglist.o"; echo /home/sakurai/tmp/nb20/src/obj/tooldir.NetBSD-2.0.1-i386/bin/sh--netbsdelf-gcc -ffreestanding -O1 -Wno-parentheses -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -fno-zero-initialized-in-bss -Devbsh3 -I. -I/home/sakurai/tmp/nb20/src/sys/arch -I/home/sakurai/tmp/nb20/src/sys -nostdinc -DSH7710 -DHZ="50" -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -c /home/sakurai/tmp/nb20/src/sys/uvm/uvm_pglist.c; /home/sakurai/tmp/nb20/src/obj/tooldir.NetBSD-2.0.1-i386/bin/sh--netbsdelf-gcc -ffreestanding -O1 -Wno-parentheses -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -fno-zero-initialized-in-bss -Devbsh3 -I. -I/home/sakurai/tmp/nb20/src/sys/arch -I/home/sakurai/tmp/nb20/src/sys -nostdinc -DSH7710 -DHZ="50" -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -c /home/sakurai/tmp/nb20/src/sys/uv!
m/uvm_pglist.c
*** Error code 1
Stop.
nbmake: stopped in /home/sakurai/tmp/nb20/src/sys/arch/evbsh3/compile/obj/ESPT2
ERROR: Failed to make all in /home/sakurai/tmp/nb20/src/sys/arch/evbsh3/compile/obj/ESPT2
*** BUILD ABORTED ***
---- < end >-----------
>How-To-Repeat:
define PGALLOC_VERBOSE and do ./build.sh.
>Fix:
pass 2nd argument to TAILQ_LAST.
#ifdef PGALLOC_VERBOSE
printf("pgalloc: %lx-%lx\n",
VM_PAGE_TO_PHYS(TAILQ_FIRST(rlist)),
- VM_PAGE_TO_PHYS(TAILQ_LAST(rlist)));
+ VM_PAGE_TO_PHYS(TAILQ_LAST(rlist, pglist)));
#endif