Followers 0

AngelScript MingW-64

5 posts in this topic

I must be missing something or is it just that AngelScript is not compatible with MingW-64.

I am using CodeBlocks with TDM-GCC MingW-64 on Windows 7 64bit

This is the same on both newest dev and release of AngelScript.

angelscript_2.25.2 and angelscript-trunk

The disassembly is from trunk if it matters.

I get SegFault on context Execute()

I am testing using the Console sample but tried tutorial sample with segfault also.

scripthelper.cpp
int ExecuteString(asIScriptEngine *engine, const char *code, asIScriptModule *mod, asIScriptContext *ctx)
Line 154
r = execCtx->Execute();

Feature Test passed all except

Failed on line 178 in test_addon_debugger.cpp

Creating Static Library using the the CodeBlocks project however I changed the defines because 64bit compilation fails with i386 option with Error: invalid instruction suffix for push' ...etc

Currently Using these defines but I have tried many different combinations with no change. Without AS_X64_GCC the featuretest SegFaults after the first 2 lines.

ANGELSCRIPT_EXPORT
WIN32
AS_X64_GCC

Disassembly

0x004049BC    callq  *%rax
0x004049BE    mov    0x74(%rbp),%edx
0x004049C1    mov    %edx,0x3c(%rbp)
0x004049C4    jmp    0x404a25 <ExecuteString(asIScriptEngine*, char const*, asIScriptModule*, asIScriptContext*)+733>
0x004049C6    mov    0x68(%rbp),%rax              <---------
0x004049CA    mov    (%rax),%rax
0x004049CD    add    $0x28,%rax 0x004049D1 mov (%rax),%rax 0x004049D4 mov 0x68(%rbp),%rdx 0x004049D8 movl$0x2,-0x28(%rbp)
`
Edited by Neuntoter
0

Share on other sites

As an update I have tried it with everything from no additional defines to manually adding defines to make sure it should be compiled with MINGW-64 options.

Still doesn't work. At this point I have to believe that the issue is an incompatibility between the compiler and and angelscript and not an issue of defines.

Also though I never mentioned it, it works properly built as 32bit.

Edited by Neuntoter
0

Share on other sites

Which version of MinGW are you using?

With version 4.7 they changed the native calling conventions considerably. I've already made the 32bit version working for both the new and old calling convention, but the 64bit version probably needs adjustment. Actually, I'm not too sure the 64bit ever worked, as I never tested it myself due to lack of environment.

I do have a I'll investigate this as soon as possible.

0

Share on other sites

This is 4.7.1

I was hoping it was simply not compatible and I wasn't missing something obvious.

I would be interested to get it working.

I am pretty sure it worked in 64bit on mingw in the past.

0

Share on other sites

MinGW 4.7 probably changed the 64bit version to be more closely matching to MSVC ABI, at least this was what they did with the 32bit version. If MinGW 64bit worked with as_callfunc_x64_mingw.cpp before, it probably needs to be updated to be more like as_callfunc_x64_msvc.cpp and as_callfunc_x64_msvc_asm.asm now.

I'm quite busy now. I have a lot to catch up after my vacation, so if you could do this investigation on your own for now it would be good. Otherwise I'll probably have to keep my investigation on this on hold for a couple of weeks.

0

Share on other sites

I've fixed the problems with MinGW64 4.7 in revision 1592.

Regards,

Andreas

0

Create an account

Register a new account