Advertisement

AngelScript iOS x64

Started by February 09, 2015 12:04 PM
26 comments, last by _Engine_ 9 years, 9 months ago

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!

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

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

Advertisement

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?

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?

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

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.

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.

Advertisement

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.

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

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.

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?

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

On iOS arm64 asGetLibraryOptions() return follow string - "AS_MAX_PORTABILITY AS_64BIT_PTR AS_IPHONE"

This topic is closed to new replies.

Advertisement