Subject: Re: 3.0_BETA build error
To: None <netbsd-users@netbsd.org>
From: Geert Hendrickx <geert.hendrickx@ua.ac.be>
List: netbsd-users
Date: 09/27/2005 14:08:04
On Mon, Sep 26, 2005 at 10:15:05PM +0200, Geert Hendrickx wrote:
> On Mon, Sep 26, 2005 at 10:47:12AM +0200, Geert Hendrickx wrote:
> > I'm constantly getting this error when building tools with an up-to-date
> > netbsd-3 src tree: 
> > 
> > > #   compile  cksum/cksum.lo
> > > cc -O -I/cvs/obj/tools/compat -I/cvs/obj/tools/compat/include  -I/cvs/src/tools/cksum/../compat -DHAVE_NBTOOL_CONFIG_H=1  -D_FILE_OFFSET_BITS=64  -c -o cksum.lo.o    /cvs/src/usr.bin/cksum/cksum.c
> > > /cvs/src/usr.bin/cksum/cksum.c:141: error: `SHA256_File' undeclared here (not in a function)
> > > /cvs/src/usr.bin/cksum/cksum.c:141: error: initializer element is not constant
> > > /cvs/src/usr.bin/cksum/cksum.c:141: error: (near initialization for `hashes[5].filefunc')
> > > /cvs/src/usr.bin/cksum/cksum.c:141: error: initializer element is not constant
> > > /cvs/src/usr.bin/cksum/cksum.c:141: error: (near initialization for `hashes[5]')
> > > /cvs/src/usr.bin/cksum/cksum.c:144: error: `SHA384_File' undeclared here (not in a function)
> > > /cvs/src/usr.bin/cksum/cksum.c:144: error: initializer element is not constant
> > > /cvs/src/usr.bin/cksum/cksum.c:144: error: (near initialization for `hashes[6].filefunc')
> > > /cvs/src/usr.bin/cksum/cksum.c:144: error: initializer element is not constant
> > > /cvs/src/usr.bin/cksum/cksum.c:144: error: (near initialization for `hashes[6]')
> > > /cvs/src/usr.bin/cksum/cksum.c:147: error: `SHA512_File' undeclared here (not in a function)
> > > /cvs/src/usr.bin/cksum/cksum.c:147: error: initializer element is not constant
> > > /cvs/src/usr.bin/cksum/cksum.c:147: error: (near initialization for `hashes[7].filefunc')
> > > /cvs/src/usr.bin/cksum/cksum.c:147: error: initializer element is not constant
> > > /cvs/src/usr.bin/cksum/cksum.c:147: error: (near initialization for `hashes[7]')
> > > /cvs/src/usr.bin/cksum/cksum.c:148: error: initializer element is not constant
> > > /cvs/src/usr.bin/cksum/cksum.c:148: error: (near initialization for `hashes[8]')
> > > 
> > > *** Failed target:  cksum.lo
> > > *** Failed command: cc -O -I/cvs/obj/tools/compat -I/cvs/obj/tools/compat/include -I/cvs/src/tools/cksum/../compat -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -c -o cksum.lo.o /cvs/src/usr.bin/cksum/cksum.c
> > > *** Error code 1
> > > 
> > > Stop.
> > > nbmake: stopped in /cvs/src/tools/cksum
> > > 
> > > *** Failed target:  dependall
> > > *** Failed command: cd /cvs/src/tools/cksum; /cvs/obj/tooldir.NetBSD-3.0_BETA-i386/bin/nbmake realall
> > > *** Error code 1
> > > 
> > > Stop.
> > > nbmake: stopped in /cvs/src/tools/cksum
> > > 
> > > *** Failed target:  dependall-cksum
> > > *** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this=""; real="/cvs/src/tools" ;; *) this="${dir}/"; real="/cvs/src/tools/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /cvs/obj/tooldir.NetBSD-3.0_BETA-i386/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget cksum dependall
> > > *** Error code 1
> > > 
> > > Stop.
> > > nbmake: stopped in /cvs/src/tools
> > > 
> > > ERROR: Failed to make tools
> > > *** BUILD ABORTED ***
> > 
> > Any idea what could be going wrong?  

Apparently this is what causes it: 

--- /cvs/src/usr.bin/cksum/cksum.c      2005-09-27 14:01:11.000000000 +0200
+++ cksum.c     2005-09-27 13:48:47.000000000 +0200
@@ -95,6 +95,7 @@
 #include <md4.h>
 #include <md2.h>
 #include <sha1.h>
+#include <crypto/sha2.h>
 #include <rmd160.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -135,6 +136,15 @@
        { "rmd160", "RMD160",
          RMD160String, RMD160TimeTrial, RMD160TestSuite,
          RMD160Filter, (_filefunc) RMD160File },
+       { "sha256", "SHA256",
+         SHA256_String, SHA256_TimeTrial, SHA256_TestSuite,
+         SHA256_Filter, (_filefunc) SHA256_File },
+       { "sha384", "SHA384",
+         SHA384_String, SHA384_TimeTrial, SHA384_TestSuite,
+         SHA384_Filter, (_filefunc) SHA384_File },
+       { "sha512", "SHA512",
+         SHA512_String, SHA512_TimeTrial, SHA512_TestSuite,
+         SHA512_Filter, (_filefunc) SHA512_File },
        { NULL }
 };

Without it, ./build.sh tools succeeds (but ./build.sh distribution fails).
What is missing here?  (Elad, I'm CC'ing because you committed this.)  

	Geert