Subject: Re: Neat. I broke top and ps.
To: gabriel rosenkoetter <gr@eclipsed.net>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: port-macppc
Date: 11/30/1999 18:13:24
On Tue, 30 Nov 1999, gabriel rosenkoetter wrote:
> uriel:usr.bin/top# pwd
> /usr/src/usr.bin/top
> uriel:usr.bin/top# make
> awk -f /usr/src/usr.bin/top/sigconv.awk /usr/include/sys/signal.h >
> sigdesc.h
> cc -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Werror -I/usr/src/usr.bin/top -I. -DORDER -DHAVE_STRERROR -c top.c
> cc -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Werror -I/usr/src/usr.bin/top -I. -DORDER -DHAVE_STRERROR -c commands.c
> cc -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Werror -I/usr/src/usr.bin/top -I. -DORDER -DHAVE_STRERROR -c display.c
> cc1: warnings being treated as errors
> display.c: In function `u_loadave':
> display.c:217: warning: passing arg 3 of `tputs' from incompatible pointer type
> [repeatedly, in various functios, same miscalling]
> *** Error code 1
>
> Stop.
Sounds like it might be lossage from libmenu?
> ... which sends me to /usr/include to rebuild, where I find:
>
> uriel:src/include# pwd
> /usr/src/include
> uriel:src/include# make
> "Makefile", line 5: Could not find bsd.crypto.mk
> Fatal errors encountered -- cannot continue
>
> (... the theory here being to install the includes that go with the
> kernel snapshot I'm using.)
>
> Now I'm up against the "where the hell do we keep secr.tgz again?"
> problem... and I cannot, for the life of me, find it anywhere on
> ftp.netbsd.org. (Would someone please put this in a FAQ somewhere?
> Please?)
You do NOT need secr.tgz for this. :-) you need
/usr/share/mk/bsd.crypto.mk. It's a make include file which deals with
pulling in the right bits of crypto.
Try "make -m /usr/src/share/mk" which looks at the make files in your
source tree, not in /usr/share/mk.
> For the time being, I comment out the bsd.crypto.mk sourcing, do a
> make includes in /usr/src/includes, and find that top still complains
> the same way. Okay, maybe that didn't make the sys includes... and it
> sure hasn't updated /usr/include/kvm.h (not that it should need
> updating anyway):
>
> uriel:src/include# ll kvm.h
> -rw------- 1 root wheel 3074 Apr 20 1996 kvm.h
> uriel:src/include# ll /usr/include/kvm.h
> -r--r--r-- 1 root wheel 3074 Jul 18 16:01 /usr/include/kvm.h
> uriel:src/include# diff kvm.h /usr/include/kvm.h
> uriel:src/include#
>
> So I return for round 3, discovering the readily evident
> /usr/src/lib/libkvm. Duh. So I make and install that only to find
> that... top STILL won't compile! Yeah!
>
> In addition, w, netstat, and ps builds die with similar errors:
>
> ...
> [w]
> cc1: warnings being treated as errors
> w.c: In function `main':
> w.c:213: warning: null format string
> *** Error code 1
You need a new compiler.. (I get this one too).
> [netstat]
> cc1: warnings being treated as errors
> if.c:74: warning: `struct in6_addr' declared inside parameter list
> if.c:74: warning: its scope is only this definition or declaration,
> if.c:74: warning: which is probably not what you want.
> if.c:75: `INET6_ADDRSTRLEN' undeclared here (not in a function)
> if.c: In function `intpr':
> if.c:93: field `in6' has incomplete type
> if.c:224: dereferencing pointer to incomplete type
> if.c: At top level:
> if.c:75: warning: `ntop_buf' defined but not used
> *** Error code 1
Need new headers.
> [ps]
> cc1: warnings being treated as errors
> keyword.c: In function `parsefmt':
> keyword.c:229: warning: null format string
> *** Error code 1
New compiler.
> Two things bother me here:
>
> 1) I'm not using ipv6. I don't want to be. I was under the impression
> my kernel and, hence, my build environment knew this.
While your kernel may know this, your ifconfig build doesn't. It builds in
IPv6 support. Just like it builds in a number of other protocol families.
:-)
> 2) Why is cc treating warnings as errors? Is that an intentional
> feature of NetBSD src Makefiles? Why?
Yes. To catch errors along the way. The idea is that if you're building
-current, you're running -current. The compiler has been changed to be
happy with null format strings, and we've added stuff to the includes.
By catching errors along the way, we prevent a lot of bugs from lingering.
Admittedly not all of us (myself included) are supper sticklers about
keeping up. :-)
I usually use a DESTDIR build environment. That way the new includes files
don't blow away my ability to compile.
> Just for good measure, I'm getting lib.tar.gz from
> ftp.netbsd.org:/pub/NetBSD/NetBSD-current/tar_files/src again, but I'm
> certain I've already got a current version and that isn't the problem.
>
> This has gotten wonky enough that I'm afraid of munging something
> quasi-permanently if I keep hacking on blindly through the brush, so
> I'm going to step back and see if someone here can't tell me the
> blatantly silly errors I'm making.
do a "make incldues" in /usr/src/lib, /usr/src/includes, and /usr/src/sys.
That should get most of them. :-)
If you really want to follow -current, get all the source and look at the
top level Makefile. :-)
Take care,
Bill