• Advertisement
Sign in to follow this  

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

This topic is 1591 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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. 

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement