[kaffe] Build failure for arm/linux

Dalibor Topic robilad at kaffe.org
Sun Apr 22 12:32:12 PDT 2007


Kiyo Inaba wrote:
> 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?

Thank you for looking into this, Kiyo.

I've added the missing patch from Sascha for kernels >2.6.9 for the jit.

I've looked at this a bit in the parrot source, where I took the routine 
from, and they are doing it the __sys_1 way. Otoh, there is a mail on 
the binutils list about a change in ABIs on arm, complete with patches 
for cache flushing in glibc, that turns up when searching for 
sys_cacheflush. So I guess the best bet on Linux is to see what globc 
does, and to copy that.

cheers,
dalibor topic

> Kiyo
> 
> _______________________________________________
> kaffe mailing list
> kaffe at kaffe.org
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe




More information about the kaffe mailing list