Jump to content

  • Log In with Google      Sign In   
  • Create Account


* * * * - 1 votes

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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 GillesH   Members   -  Reputation: 102

Like
0Likes
Like

Posted 11 September 2013 - 06:42 AM

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. 

 



Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3220

Like
0Likes
Like

Posted 11 September 2013 - 10:36 AM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS