Jump to content
  • Advertisement
Sign in to follow this  
Creobit Builder

AngelScript iOS x64

This topic is 1242 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, everyone!

We use AngelScript in our engine and it works fine. But since the new iOS x64 requirements were published we have to add x64 support into it.

I get this error every time I try to build AngelScript for iOS armv7 arm64.

[attachment=25865:?????? ?????? 2015-02-09 ? 14.08.05.png]

[attachment=25862:?????? ?????? 2015-02-09 ? 13.25.37.png]

If I define AS_MAX_PORTABILITY the project builds successfully, but when I call for RegisterGlobalFunction it returns -7 (asNOT_SUPPORTED).

[attachment=25863:?????? ?????? 2015-02-09 ? 14.02.14.png]

[attachment=25864:?????? ?????? 2015-02-09 ? 14.03.17.png]

Please help me to fix it.

Thanx in advance!

Share this post


Link to post
Share on other sites
Advertisement

Hi Creobit,

 

unfortunately native calling conventions on iOS 64bit is not yet supported (nor is any other 64bit ARM platform). I don't have access to any 64bit ARM platform so I can't implement this support myself, but if you want to give it a try on your own I can guide you through it. It usually doesn't take more than a week or two to get it to work. Although it involves assembler code it doesn't require a lot of understanding of assembler code since most of the time it is just a matter of copying existing code obtained by disassembling C++ compiled functions :).

 

Compiling the library with AS_MAX_PORTABILITY works but then you cannot use the native calling conventions asCALL_CDECL, asCALL_THISCALL etc. That's why you get the error asNOT_SUPPORTED when trying to register the function 'void sleep(uint)' with calling convention asCALL_CDECL. Instead you need to provide proxy functions that use the asCALL_GENERIC calling convention. The templated wrapper functions in the add-ons will reduce the amount of work needed to write the proxy functions. Most of the time it is just a matter of replacing the asFUNCTION/asMETHOD macro with the corresponding WRAP_FN/WRAP_MFN macros.

 

Regards,

Andreas

Share this post


Link to post
Share on other sites

Hi!

 

Angelscript on iOS x64 have strange trouble - angelscript crashes when null pointer exception occurs in script. Maybe i need use some define that will help to not crash when null pointer exception occurs?

Share this post


Link to post
Share on other sites

I need more information in order to give an appropriate answer.

 

  • Can you give more detail about the crash?
  • Where is the null pointer exception being thrown from?
  • What does the callstack look like when the crash occurs?
  • Is the null pointer exception you refer o a C++ exception or script exception?

Share this post


Link to post
Share on other sites
Be careful when using "x64" - people usually interpret that as Intel x86-64 and not arm64. Say arm64 if you mean arm64.

I'm not aware of iOS running on x64 processors, just arm64 processors.

Share this post


Link to post
Share on other sites

Script code thats leads to crash looks like:

 

class SomeClass

{

   float some_value;

};

 

SomeClass@ obj;

obj.some_value = 0;

 

In this sample we just accessing to property of null object.

 

On non arm64 system angelscript just throw null pointer exception. On iOS arm64 system angelscript randomly crashes. Therefore callstack always different.

Share this post


Link to post
Share on other sites

That's odd. The context->Execute() call should return -3 (asEXECUTION_EXCEPTION) in this scenario. It should definitely not cause any C++ null pointer exception.

Share this post


Link to post
Share on other sites

Hi!

 

I found that's AS on iOS arm64 system not properly work with inner stack  (somewhere pointers assumed as 4 byte lenght not 8 byte length) when from script called c++ cast function (we register two c++ classes and register cast function from one to another). AmgelsScript crashes after such calls. Maybe somewhere else wrong work with pointers has place.

Edited by _Engine_

Share this post


Link to post
Share on other sites

This is a different scenario than in your previous one. Does the crash happen in both cases?

 

Can you show me the value of the string returned by asGetLibraryOptions() when called on iOS arm64?

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!