[kaffe] Build failure for arm/linux

Kiyo Inaba inaba at src.ricoh.co.jp
Sat Apr 21 22:33:11 PDT 2007

I started to build on arm/linux with CVS head.
And I noticed, there should be a kernel version related problem.
According to the ML archive, this port was reported to work by Iliverez
(http://www.kaffe.org/pipermail/kaffe/2006-March/104166.html) but the
report does not mention kernel version.

I am now using 'Linux debian 2.6.18-4-versatile' running on QEMU, and
without modifying anything, compilation stops with
md.c: In function 'flush_dcache':
md.c:39: error: expected ':' or ')' before '__sys1'
md.c:35: warning: unused parameter 'start'
md.c:35: warning: unused parameter 'end'
make[2]: [libkaffevm_la-md.lo] Error 1 (ignored)

Since 'flush_dcache' is not needed for intrp engine, I temporally comment
out the function definition, and compilation is ok, and regression tests
report 5 errors.

Then I have to start to test the arm/linux port with jit engine, and
this means I really have to make the flush_dcache function. When I
check the definition '__sys1' in include file, I noticed this should
not be compiled.

According to the code segment in '/usr/include/asm/unistd.h'
#ifdef __KERNEL__
#include <linux/linkage.h>

#define __sys2(x) #x
#define __sys1(x) __sys2(x)
the __sys1 definition should not be invoked if SYMBOL '__KERNEL__'
is ont defined. (Of course, this ifdef is mainly used to determine
whether the source is now compiled to build kernel or not)

I have no idea to track back the change for this file, but this
may be introduced recently, and the kaffe build becomes fail.

When I enforce symbol '__KERNEL__' defined in 'md.c', the compilation
(only) works.

So, what is the best way to fix this compilation problem? I can think,
 1) Define '__KERNEL__' in md.c
 2) Copy __sys1(x) and several other defs needed from 'unistd.h'
 3) Revert the def for flush_dcache without using __sys1
as candidates.

Any suggestion?


More information about the kaffe mailing list