🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Globally registered function: Only first 4 arguments are passed (ARM)

Started by
0 comments, last by WitchLord 10 years, 10 months ago

Hi,

We have crosscompiled the angelscript library (2.26.3) to be running on a embedded board running ARM linux. It is running perfectly, we only ran into one issue.

When we register a global function with more than 4 arguments, it is accepted by the compiler. Once we call the function from angelscript, the first 4 parameters are passed through, but the 5th and further parameters are not set in the function.

r = engine->RegisterGlobalFunction("void testFunc(int8 a,int8 b,int8 c,int8 d,int8 e,int8 f,int8 g,int8 h) ", asFUNCTION(BaseAPI::testFunc), asCALL_CDECL);
void BaseAPI::testFunc(char a,char b,char c, char d, char e, char f,char g, char h)
{
}
Is this a bug in the ARM implementation, or are we doing something wrong?
Thanks in advance.

Advertisement

It is likely a case of your system using a slightly different ARM ABI that what the code is prepared for. Currently the code has support for the ABIs used by iOS, Android, Marmalade, Windows, and with the latest contribution from loboWu Linux with the variations armeabi + vfp or armeabihf (both thumb and normal mode).

Does the manual for your system specify exactly which variant of the ARM ABI it uses?

I assume you use gnuc to compile the library. Can you obtain the preprocessor flags that gnuc defines automatically on your system? Sometimes these give a hint of what ABI is used.

You ought to be able to get the preprocessor flags with a command like this:

echo . | g++ $CXXFLAGS -dM -E -

Where $CXXFLAGS shouild contain all the flags you normally pass to the compiler, such as target architecture, etc.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement