[kaffe] Re: kaffe for m68k/linux and m68k/netbsd

Kiyo Inaba inaba at src.ricoh.co.jp
Tue May 18 21:54:02 PDT 2004


For m68k/NetBSD, I found one fuzz which makes jit does not work.

In 'config/m68k/jit.h', the struct methodTrampoline looks like
------------------------------------------------------------------
typedef struct _methodTrampoline {
        unsigned short call;
        int fixup;
        struct _methods* meth;
        void** where;
} methodTrampoline;
------------------------------------------------------------------

And this declaration is OK for (at least) woody but not good for
recent versions of NetBSD. The gcc on NetBSD tries to keep 4 bytes
alignment for 'short' values.
# BTW, fixup is the argument of call and should not have any pads.

Trivial fix for this is something like, 
------------------------------------------------------------------
typedef struct _methodTrampoline {
        unsigned short call;
        int fixup __attribute__ ((packed));
        struct _methods* meth;
        void** where;
} methodTrampoline;
------------------------------------------------------------------

I am wondering when the behavier was changed on NetBSD, since I remember
at least once the original code worked.

Kiyo
P.S. I am now testing cross-compiling environment for NetBSD 1.5.3 and
     1.6.?, (mainly debuging some faulty behavior of recent libtools)
     and I am not sure whether this is the only problem or not.
.




More information about the kaffe mailing list