Re: GCC 3.2 errors
Chris Wilkes <[email protected]> Sat, 26 Jul 2003 20:32:14 -0700
| Newsgroups | gmane.comp.djb.cdb |
|---|---|
| Message-ID | <[email protected]> |
On Sun, Jul 27, 2003 at 01:56:51AM +0800, Neo Wee Teck wrote:
> Anyone have the problem compiling cdb with GCC 3.2?
It would be helpful if you posted your error messages.
> Any patches for it?
I just tried and got the errno problem:
./load cdbget cdb.a buffer.a unix.a byte.a
cdb.a(cdb.o)(.text+0xce): In function `cdb_read':
: undefined reference to `errno'
[ repeat for a couple other packages ]
Which has been talked about alot on the qmail mailing list:
http://marc.theaimsgroup.com/?l=qmail&w=2&r=1&s=errno&q=b
The patches for most of DJB's software are here:
http://qmail.org/moni.csi.hu/pub/glibc-2.3.1/
Except, unfortunately, for the CDB package. However its not that hard
to do, just change "extern int errno" to "#include <errno.h>" in
error.h, or you can use the patch at the end of my post. To apply it do
something like this:
cd cdb-0.75
patch -p1 < ../cdb-0.75-errno.patch
Which fixes that compile problem. However doing the automatic test as
described on DJB's webpage
http://cr.yp.to/cdb/install.html
# ./rts > rts.out
# cmp rts.out rts.exp
rts.out rts.exp differ: byte 3670, line 202
Line 202 in my rts.out is
--- cdbmake handles nomem
cdbmake: fatal: unable to read input: bad format
111
When it should be this from rts.exp
cdbmake: fatal: unable to create test.tmp: out of memory
Looking at rts.tests that test is:
echo '--- cdbmake handles nomem'
csh -cf 'repeat 5000 echo "+3,5:one->Hello"' \
| softlimit -d 50000 cdbmake test.cdb test.tmp
echo $?
Anyone else getting that error, or is just me? I do have softlimit
installed. The "manual test" on DJB's webpage pass.
Chris
diff -u cdb-0.75.old/error.h cdb-0.75/error.h
--- cdb-0.75.old/error.h 2003-07-26 20:17:59.000000000 -0700
+++ cdb-0.75/error.h 2003-07-26 20:18:20.000000000 -0700
@@ -1,7 +1,7 @@
#ifndef ERROR_H
#define ERROR_H
-extern int errno;
+#include <errno.h>
extern int error_intr;
extern int error_nomem;