[kaffe] openbsd sysctl.h present but cannot be compiled + workaround

Frederick C. Druseikis fredd at cse.sc.edu
Thu Aug 10 13:40:06 PDT 2006

Hi All,

I am building Kaffe-1.1.7 for OpenBSD-current (4.0-beta) with

We know that everything builds and works without problems
for --with-engine=intrp.

The following message is reported by the configure step with
--with-engine=jit3 :

checking sys/sysctl.h usability... no
checking sys/sysctl.h presence... yes
configure: WARNING: sys/sysctl.h: present but cannot be compiled
configure: WARNING: sys/sysctl.h:     check for missing
prerequisite headers?
configure: WARNING: sys/sysctl.h: see the Autoconf documentation
configure: WARNING: sys/sysctl.h:     section "Present But Cannot
Be Compiled"
configure: WARNING: sys/sysctl.h: proceeding with the
preprocessor's result
configure: WARNING: sys/sysctl.h: in the future, the compiler will
take precedence
configure: WARNING:     ## ------------------------------ ##
configure: WARNING:     ## Report this to kaffe at kaffe.org ##
configure: WARNING:     ## ------------------------------ ##
checking for sys/sysctl.h... yes

BTW, the resulting kaffe binary from the compile is totally
useless -- it segfaults on hello world.

Here is a workaround:

Create a separate include directory:


and specify the following include paths to gcc (order is

-I$HOME/funky/include -I/usr/local/include -I/usr/include

and define the funky sysctl.h as the following two lines only:

#include "/usr/include/sys/param.h"
#include "/usr/include/sys/sysctl.h"

When these overrides are used (I'm working through the OpenBSD
ports system) I get a clean configure, everything builds, and it
runs great!  The resulting binary runs Eclipse 3.1 flawlessly.

Hopefully this will be enough input to patch kaffe so that I don't
need the "funky sysctl.h"  If someone wants to suggest a patch I
can test it.


Frederick C Druseikis
(fredd at cse.sc.edu)

More information about the kaffe mailing list