Menu

#4 Make breaks on FreeBSD 4.7

open
nobody
None
5
2003-03-25
2003-03-25
No

FreeBSD 4.7 -- straight configuration: make breaks:

1. src/pidalloc.cpp needs '#include <pthread.h>'

2. src/mod/xp_pcap_interface.c:136: assignment to
'unsigned char *' from 'char *' changes signedness.

pcap_next() returns u_char * on FreeBSD (which
translates to 'const unsigned char *'). Changing the
(char *) cast to (unsigned char *) fixed it, but
there's something fundamentally wrong about dropping
const in that way in C++. (I suspect those DARWIN
defines may have something to do with this, as well...)

After that compiling worked, but linking failed.

Linking is done -lpthread, which doesn't exist (pthread
is in libc_r). On FreeBSD (at least) the thing should
be '-pthread' (no l) instead -- it's a special gcc-hack
to use libc_r instead of libc. Edited the makefile to
fix this.

(-O6 did not produce any complaints, but it's not
documented to work. I've never seen anyone do more than
-O2 on a FreeBSD system. Changed this as well, just to
be on the safe side.)

After that, make and installation went OK. Looks like
it runs OK as well.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB