Subject: Can't build binstall or cap_mkdb in new tools
To: None <current-users@netbsd.org>
From: Lloyd Parkes <lloyd@must-have-coffee.gen.nz>
List: current-users
Date: 03/02/2002 09:19:28
If I try and run build.sh simply (e.g. ./build.sh -t -O 
/vol/NetBSD/build/i386/obj), the build breaks with following message

	dependall ===> cap_mkdb
	...
	cc -O -I/vol/NetBSD/build/i386/obj/tools/compat
	  -I/vol/NetBSD/build/i386/obj/tools/compat/include
	  -I/vol/NetBSD/build/src/tools/cap_mkdb/../compat -DHAVE_CONFIG_H
	  -D_FILE_OFFSET_BITS=64    -o cap_mkdb cap_mkdb.lo getcap.lo
	  -L/vol/NetBSD/build/i386/obj/tools/compat -lnbcompat -lutil -lz
	/usr/lib/libc.a(db.o): In function `__dbpanic':
	db.o(.text+0xa4): multiple definition of `__dbpanic'
	/vol/NetBSD/build/i386/obj/tools/compat/libnbcompat.a(db.lo)(.text+0xb0):
	  first defined here
	collect2: ld returned 1 exit status
	*** Error code 1

I did some digging and eventually thought to myself. Why is the system trying 
to work with a compatibility library that only seems to be tested under 
Solaris and Linux, so I found NOCOMPATLIB and tried setting this in my 
environment.

The command NOCOMPATLIB=1 ./build.sh -t -O /vol/NetBSD/build/i386/obj now 
gives be trouble earlier in the build process

	...
	dependall ===> binstall
	/vol/NetBSD/build/tools/bin/nbhost-mkdep -a   -I/vol/NetBSD/build/src/tools/bi
nstall/../../usr.bin/xinstall/../../bin/ls /vol/NetBSD/build/src/tools/binstall
/../../usr.bin/xinstall/xinstall.c
	cc -O   -I/vol/NetBSD/build/src/tools/binstall/../../usr.bin/xinstall/../../bi
n/ls -c -o xinstall.lo /vol/NetBSD/build/src/tools/binstall/../../usr.bin/xinst
all/xinstall.c
	cc -O   -I/vol/NetBSD/build/src/tools/binstall/../../usr.bin/xinstall/../../bi
n/ls   -o xinstall xinstall.lo
	xinstall.lo: In function `do_link':
	xinstall.lo(.text+0x788): warning: mktemp() possibly used unsafely, use 
mkstemp() or mkdtemp()
	xinstall.lo: In function `main':
	xinstall.lo(.text+0x501): undefined reference to `string_to_flags'
	collect2: ld returned 1 exit status
	*** Error code 1

My I switched on debuging flags for make, and SRCS and and OBJS seems to get 
set correctly such that the source for string_to_flags gets pulled in from ls, 
but as can been seen from the log, it doesn't happen.

So, why me?