Hi,

after compiling and testing the library DirectFB (directfb.org) I figured out some annoying effect concerning the ABI.
DirectFB uses some sort of interface which can be summarized as:
-------------------------
void f(int a, int b, int c){/*Do something with a,b and c*/}

typedef void (*Genericf)(int a, ....);
Genericf g = (Genericf)f;
g(1, 2, 3); // <- Crash on OpenRISC because of different calling conventions for variadic functions.
-------------------------

As far as I know there is nothing written in the C specification which says, that this should work. So I don't blame that the OpenRISC ABI is wrong. I think that DirectFB makes a terrible design decision.
That they claim, there software is for embedded systems makes it even worse.
But it seems that especially the ABIs of x86 and ARM are defined in a way that makes this possible.
I have not checked the others architectures.

If I don't get any objection about the fact I will send some similar mail to the DirectFB mailing list.

I hope that this is the only library which is using such a design. Otherwise I would suggest to change the OpenRISC ABI. Unfortunately it seems that DirectFB will not compile correctly on OpenRISC without a substantial change in the source code.

Sebastian


_______________________________________________
OpenRISC mailing list
OpenRISC@lists.openrisc.net
http://lists.openrisc.net/listinfo/openrisc

Reply via email to