Subject: Re: Building current from 2.0.2
To: Dan McGregor <danismostlikely@gmail.com>
From: Greg Troxel <gdt@ir.bbn.com>
List: current-users
Date: 08/04/2005 07:55:15
  I was wondering if it's normal to have -current fail to build from
  2.0.2?  The command I'm using to build is:  ./build.sh -D
  /home/src/destdir.i386 -T  /home/src/tooldir.NetBSD-2.0.2-i386  -U -R
  /usr/newrelease distribution

No, it's not normal - you should be able to build the head of any
maintained branch (netbsd-2-0, netbsd-2, netbsd-3, current) from
anything 2.0ish and later.  (Actually broader than that, but I'm not
100% sure of the edges.)  I've just done builds of current and
netbsd-3 from 2.99.15.

Sometimes current is broken.  So generic advice is to Wait a day, cvs
update, and rerun build.sh (add '-u' so it doesn't clean everything
first, perhaps, but on the other hand also try rm -rf the
obj/dest/release/tools dirs to avoid persistent trouble).

I append a snippet from a build of current done on August 2, under
2.99.15.  I am pretty sure 2.99.15 that is after the statvfs change,
which is suspicious, since while it's a bug for the build to use host
includes and libraries, that sometimes happens and is not always
caught if host and target are similar.

  /home/src/destdir.i386/lib/libc.so: undefined reference to `getfsstat'
  /home/src/destdir.i386/lib/libc.so: undefined reference to `SYS_statfs'

It looks like the libc in your destdir is bad.
src/sys/lib/libc/sys/statfs.c, which implements getfsstat, uses
statvfs.

I noticed you didn't set OBJDIR; I'd rm -rf the OBJDIR path and try
again - it could have stale files from a previous build.


I did (via a script):

./build.sh -m i386 -u -U -O /usr/obj/auto-current/i386 -T /usr/obj/auto-current/tools -D /usr/obj/auto-current/i386/destdir -R /usr/obj/auto-current/releasedir -X /n0/gdt/NetBSD-current/xsrc tools

./build.sh -m i386 -x -u -U -O /usr/obj/auto-current/i386 -T /usr/obj/auto-current/tools -D /usr/obj/auto-current/i386/destdir -R /usr/obj/auto-current/releasedir -X /n0/gdt/NetBSD-current/xsrc distribution

dependall ===> gnu/libexec/uucp/cu
#   compile  cu/cu.o
/usr/obj/auto-current/tools/bin/i386--netbsdelf-gcc -O2  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wno-format-zero-length -Werror   -I/n0/gdt/NetBSD-current/src/gnu/libexec/uucp/cu/../common_sources -DVERSION=\"1.06.1\" -DPOSIX_HEADERS  -nostdinc -isystem /usr/obj/auto-current/i386/destdir/usr/include  -c    /n0/gdt/NetBSD-current/src/gnu/libexec/uucp/cu/cu.c
#   compile  cu/prot.o
/usr/obj/auto-current/tools/bin/i386--netbsdelf-gcc -O2  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wno-format-zero-length -Werror   -I/n0/gdt/NetBSD-current/src/gnu/libexec/uucp/cu/../common_sources -DVERSION=\"1.06.1\" -DPOSIX_HEADERS  -nostdinc -isystem /usr/obj/auto-current/i386/destdir/usr/include  -c    /n0/gdt/NetBSD-current/src/gnu/libexec/uucp/common_sources/prot.c
#   compile  cu/log.o
/usr/obj/auto-current/tools/bin/i386--netbsdelf-gcc -O2  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wno-format-zero-length -Werror   -I/n0/gdt/NetBSD-current/src/gnu/libexec/uucp/cu/../common_sources -DVERSION=\"1.06.1\" -DPOSIX_HEADERS  -nostdinc -isystem /usr/obj/auto-current/i386/destdir/usr/include  -c    /n0/gdt/NetBSD-current/src/gnu/libexec/uucp/common_sources/log.c
#   compile  cu/chat.o
/usr/obj/auto-current/tools/bin/i386--netbsdelf-gcc -O2  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wno-format-zero-length -Werror   -I/n0/gdt/NetBSD-current/src/gnu/libexec/uucp/cu/../common_sources -DVERSION=\"1.06.1\" -DPOSIX_HEADERS  -nostdinc -isystem /usr/obj/auto-current/i386/destdir/usr/include  -c    /n0/gdt/NetBSD-current/src/gnu/libexec/uucp/common_sources/chat.c
#   compile  cu/conn.o
/usr/obj/auto-current/tools/bin/i386--netbsdelf-gcc -O2  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wno-format-zero-length -Werror   -I/n0/gdt/NetBSD-current/src/gnu/libexec/uucp/cu/../common_sources -DVERSION=\"1.06.1\" -DPOSIX_HEADERS  -nostdinc -isystem /usr/obj/auto-current/i386/destdir/usr/include  -c    /n0/gdt/NetBSD-current/src/gnu/libexec/uucp/common_sources/conn.c
#   compile  cu/copy.o
/usr/obj/auto-current/tools/bin/i386--netbsdelf-gcc -O2  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wno-format-zero-length -Werror   -I/n0/gdt/NetBSD-current/src/gnu/libexec/uucp/cu/../common_sources -DVERSION=\"1.06.1\" -DPOSIX_HEADERS  -nostdinc -isystem /usr/obj/auto-current/i386/destdir/usr/include  -c    /n0/gdt/NetBSD-current/src/gnu/libexec/uucp/common_sources/copy.c
#      link  cu/cu
/usr/obj/auto-current/tools/bin/i386--netbsdelf-gcc -Wl,-nostdlib     -o cu  -Wl,-rpath-link,/usr/obj/auto-current/i386/destdir/lib:/usr/obj/auto-current/i386/destdir/usr/lib  -L/usr/obj/auto-current/i386/destdir/lib  -B/usr/obj/auto-current/i386/destdir/usr/lib/ -B/usr/obj/auto-current/i386/destdir/usr/lib/   cu.o prot.o log.o chat.o conn.o copy.o /usr/obj/auto-current/i386/gnu/libexec/uucp/libunix/libunix.a /usr/obj/auto-current/i386/gnu/libexec/uucp/libuuconf/libuuconf.a /usr/obj/auto-current/i386/gnu/libexec/uucp/libuucp/libuucp.a   -L/usr/obj/auto-current/i386/destdir/usr/lib -L/usr/obj/auto-current/i386/destdir/usr/lib

-- 
        Greg Troxel <gdt@ir.bbn.com>