Compiling angelscript on ppc64

Started by
43 comments, last by WitchLord 7 years, 8 months ago

Yes, it is working now!

I'll keep debugging the other issues. I'll come back with more things soon.

Advertisement

Patch for enabling datetime test compilation on gcc.

Edit: missed a change on add_on/datetime/datetime.cpp. Another patch attached.

Thanks. I've checked in these fixes in revision 2330.

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

Andreas,

now test_namespace is the one failing. Particularly these lines:

606 " assert(a::e1 == 1); \n"
607 " assert(a::e::e1 == 1); \n"
The problem comes from the way the enum value is evaluated. In as_builder.cpp:2299, the following code
e->value = *(int*)&gvar->constantValue;
gives the wrong value in PPC because constantValue is an asQWORD with value 0x0000000000000001, so the 'int' portion is 0.
fprintf(stderr, "gvar->value is 0x%016lx and converted is 0x%08x\n", gvar->constantValue, *(int *)&gvar->constantValue); // as_builder.cpp:2300
results in
"gvar->value is 0x0000000000000001 and converted is 0x00000000".
This problem does not happen for all cases. For some, the right portion of the constantValue is evaluated, as we can see from the output below. I guess when we save a constant enum value we save the whole QWORD instead of saving only the 'int' portion in the gvar.
gvar->value is 0x00000000deadbeef and converted is 0x00000000
gvar->value is 0x00000001deadbeef and converted is 0x00000001
gvar->value is 0x00000002deadbeef and converted is 0x00000002
gvar->value is 0x00000000deadbeef and converted is 0x00000000
gvar->value is 0x00000001deadbeef and converted is 0x00000001
gvar->value is 0x00000002deadbeef and converted is 0x00000002
gvar->value is 0x00000000deadbeef and converted is 0x00000000
gvar->value is 0x00000000deadbeef and converted is 0x00000000
gvar->value is 0x0000000000000000 and converted is 0x00000000
gvar->value is 0x0000000000000001 and converted is 0x00000000

What about the attached patch? With it, all tests up to test_compiler pass.

Failed on line 1742 in ../../source/test_compiler.cpp

The attached patch fixes the previous mentioned error in test_compiler.cpp:1742

Next errors are now:

Failed on line 1851 in ../../source/test_compiler.cpp
Failed on line 1857 in ../../source/test_compiler.cpp

Thanks. I'll review and include these patches.

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

I've checked in the patches in revision 2338.

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

Andreas,

the tests to check the division of -2147483648 by -1 were failing on PPC. That's because when the value (1<<31) is parsed, it's saved as an int64 (0xffffffff80000000). If we get a dword from that, we get the 0xffffffff part on big endians. So int values need to be properly downsized.

The attached patch fixes this problem BUT it's not the proper solution. Do you have any ideas how to better do this? Maybe we need to properly parse int32 vs int64 values?

Thanks. I'll look into this.

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

This topic is closed to new replies.

Advertisement