Hi,
when I try to compile angelscript on a ppc64 machine, I get the following error:
Hi,
when I try to compile angelscript on a ppc64 machine, I get the following error:
Apparently the configuration in as_config.h is not detecting that you're actually compiling for a PPC64 CPU. Instead it is lead to think you're targeting an AMD64 CPU.
The conditions in as_config.h should, based on the pre-defines provided by the compiler, define the AS_PPC_64 macro, instead it is defining the AS_X64_GCC macro (or perhaps it is defining both for some reason).
I assume you're using a gnuc compiler (or one derived from it). If so you should be able to get the list of pre-defines provided by the compiler with the following command:
echo . | g++ -dM -E -
Add whatever extra compiler arguments you use to target your specific platform.
Show me the output from that command and I can help you try to identify what might be wrong in the as_config.h file for your compiler and platform.
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 assume you're using a gnuc compiler (or one derived from it). If so you should be able to get the list of pre-defines provided by the compiler with the following command:
echo . | g++ -dM -E -
Add whatever extra compiler arguments you use to target your specific platform.
Show me the output from that command and I can help you try to identify what might be wrong in the as_config.h file for your compiler and platform.
These are all the flags used: CXXFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -fno-strict-aliasing'
This is the output of the command:
Alright. Based on this I can see that as_config.h is indeed identifying the platform as a Linux with x86/64 CPU.
Please make the following changes to the file and let me know how it works out for you:
On line 847 add a condition not to enter the x86/64 code path like this:
#elif defined(__LP64__) && !defined(__arm64__) && !defined(__PPC64__)
On line 914 add the following before the #else, to create a specific configuration for Linux with PPC64 processors:
#elif defined(__PPC64)
// Support native calling conventions on Linux with PPC64
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
The compilation went fine, with just the warnings below.
Is there a test you use that I can run to check it actually works on ppc64?
In the meantime, I'll check what modifications are need for ppc64le and send a patch containing both (if possible).
To test if everything is working OK, you can run the regression test suite (available in the SVN http://svn.code.sf.net/p/angelscript/code/trunk/).
Go to the directory <your location>/sdk/tests/test_feature/projects/gnuc/ run make, then execute the testgnuc binary from the directory <your location>/sdk/tests/test_feature/bin/
If everything is fine all the tests will pass successfully. If there is anything wrong one of the tests will fail. Then it will be a matter of debugging the code to figure out what went wrong.
If you look at the main.cpp file in the <your location>/sdk/tests/test_feature/source/ folder, you'll see the list of tests that will be executed. If you're getting lots of errors it is a good idea to comment out all of the tests except for the one that start at line 348. These tests have been designed specifically for figuring out the details of the ABI, and stat with the most simplest case, of calling a function without any arguments or return value, and then increasing the complexity of the function calls to the most complex calls including virtual methods taking and returning objects by value.
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 first time I ran the tests I got this output:
OK, so you went with the MAX_PORTABILITY mode. That's probably wise and a good start. :)
The first 3 tests passed successfully, so the problem is probably specific for the weak reference scenarios in Test_Addon_WeakRef. Most likely it has something to do with the fact that PPC64 is 64bit and big endian, which is something that would be specific for your platform. No other platform that I know AngelScript is running on has this particularity. Not even PlayStation3 has 64bit pointers, even though the CPU is based on PPC64 architecture. (I'm not sure about Xbox 360, but I'm guessing it too has only 32bit pointers).
Can you debug the code to try to figure out where it is going wrong? Or else, perhaps you can give me remote access to your machine over SSH so I can do a little debugging on my own?
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Can you debug the code to try to figure out where it is going wrong? Or else, perhaps you can give me remote access to your machine over SSH so I can do a little debugging on my own?
I'll be investigating the issue. Anyway, if you want access to a ppc64 guest you can fill in the form in https://fit-rhlab.rhcloud.com/powerlinux-openpower-development-hosting/.
Let me know if you need anything.
Andreas,
this is the information I was able to gather so far about the error:
the tests segfaults in this function 'void *asCGeneric::GetAddressOfReturnLocation()'
as we can see, returnType.isReference is true. That means the test 'if( dt.IsObject() && !dt.IsReference() )' is false, taking us to the end of the function