Google Play New problem : 64bits

All topics about ZGameEditor goes here.

Moderator: Moderators

User avatar
Ats
Posts: 835
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Google Play New problem : 64bits

Post by Ats »

Building Android 64 lib gives those errors:
Building libzgeandroid.so for Android 64 (arm64-v8a)...

Free Pascal Compiler version 3.2.2 [2021/05/16] for aarch64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Android for AArch64
Compiling zgeandroid.pas
Compiling jni.pas
Assembling jni
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZOpenGL.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZMath.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZClasses.pas
ZClasses.pas(591,5) Warning: Constructor should be public
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZMath.pas
ZMath.pas(662,1) Warning: Function result variable does not seem to be initialized
Assembling zmath
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZLog.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZPlatform.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\AudioPlayer.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\AudioComponents.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZApplication.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\Meshes.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZBitmap.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\Renderer.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\Meshes.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZExpressions.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZApplication.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\Meshes.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZApplication.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\Collision.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZApplication.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\Commands.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZApplication.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\GLDrivers.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\Renderer.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\ZApplication.pas
Compiling C:\Users\Ats\Desktop\zgameeditor-master\GLDrivers.pas
Assembling gldrivers
ZApplication.pas(321,3) Note: Local variable "I" not used
ZApplication.pas(714,46) Warning: Local variable "Matrix" does not seem to be initialized
ZApplication.pas(1117,8) Warning: Conversion between ordinals and pointers is not portable
Assembling zapplication
Renderer.pas(805,17) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
Renderer.pas(972,23) Warning: Local variable "TextBuf" does not seem to be initialized
Renderer.pas(1466,20) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
Renderer.pas(1467,20) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
Renderer.pas(1607,66) Warning: Local variable "ScaledGravity" does not seem to be initialized
Renderer.pas(1732,5) Note: Local variable "S" is assigned but never used
Renderer.pas(2170,3) Note: Local variable "FilterTypes" not used
Assembling renderer
Assembling commands
Assembling collision
Assembling meshes
ZExpressions.pas(779,5) Warning: Function result variable does not seem to be initialized
ZExpressions.pas(1889,20) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
ZExpressions.pas(1914,22) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
ZExpressions.pas(2159,28) Warning: Local variable "Dest" does not seem to be initialized
ZExpressions.pas(2852,3) Note: Local variable "OldProtect" not used
ZExpressions.pas(3135,36) Warning: Local variable "V" does not seem to be initialized
ZExpressions.pas(3544,20) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead.
Assembling zexpressions
obj\arm64-v8a\ZExpressions.s: Assembler messages:
obj\arm64-v8a\ZExpressions.s: 3578: Error: found ',', expected: ']'
obj\arm64-v8a\ZExpressions.s: 3578: Error: found ',', expected: ']'
obj\arm64-v8a\ZExpressions.s: 3578: Error: found ',', expected: ']'
obj\arm64-v8a\ZExpressions.s: 3578: Error: unexpected characters following instruction at operand 2 -- `mov x1,[sp,#8]'
obj\arm64-v8a\ZExpressions.s: 3579: Error: found ',', expected: ']'
obj\arm64-v8a\ZExpressions.s: 3579: Error: found ',', expected: ']'
obj\arm64-v8a\ZExpressions.s: 3579: Error: found ',', expected: ']'
obj\arm64-v8a\ZExpressions.s: 3579: Error: unexpected characters following instruction at operand 2 -- `mov x2,[sp,#16]'
obj\arm64-v8a\ZExpressions.s: 3582: Error: operand 1 should be an integer register -- `mov [sp,#24],x0'
obj\arm64-v8a\ZExpressions.s: 3577: Error: undefined symbol sp used as an immediate value
obj\arm64-v8a\ZExpressions.s: 3580: Error: immediate cannot be moved by a single instruction
ZExpressions.pas(3717) Error: Error while assembling exitcode 1
ZExpressions.pas(3717) Fatal: There were 2 errors compiling module, stopping
And since it’s assembly, I really can’t verify what Gemini is babbling about after I explain the problem, the new function, and the resulting compilation error… :?

To add to the confusion, chatGPT doesn't agree with its counterpart:
There is no sys_cacheflush syscall on ARM64 / AArch64 Linux or Android.
It simply does not exist. On 32-bit ARM, yes, there was __ARM_NR_cacheflush, but on AArch64, the kernel does not expose it, and you cannot invent a syscall number like $0F0002 on AArch64. That number is not meaningful on ARM64. That is why your approach is fundamentally wrong.
Is this true, or is this made up? :lol:
https://stackoverflow.com/questions/434 ... tive-arm64
User avatar
VilleK
Site Admin
Posts: 2387
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Google Play New problem : 64bits

Post by VilleK »

Ok I will try a different approach in the next few days.
User avatar
VilleK
Site Admin
Posts: 2387
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Google Play New problem : 64bits

Post by VilleK »

Please pull the latest source changes from Github. I've reduced the number of code generation blocks required when making external function calls. This should hopefully make it more stable.

I've only tested compilation for Windows so let me know if there are errors when compiling for Android.
User avatar
Ats
Posts: 835
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Google Play New problem : 64bits

Post by Ats »

ZExpressions.pas(2344,23) Error: identifier idents no member "Proc"

I believe line 2344 should be:
PDummyFunc(Self.Entry.Proc)^(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); //Should never execute

Now it compiles and runs fine. I’m running the thousand-cubes test: no crash. This seems very promising :D
I’ll let it run on two devices while I finish watching a movie, then I’ll try it with my game!
User avatar
Ats
Posts: 835
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Google Play New problem : 64bits

Post by Ats »

Well done!

I’ve been playing my game for quite a while, with all kinds of semi-transparent lasers and explosions, and in many different situations. Not a single crash.

giphy.gif
giphy.gif (374.37 KiB) Viewed 7 times
I can’t express how happy and relieved I am. That was one hell of a bug hunt...

Tomorrow I’ll release the previous version of Omeganaut for Android 64. Then I’ll finally be ready to start feeding the project with lots of content.

For the knowledge, Ville, could you explain what you changed in your last commits? I believe you replaced pointers with something else?
Post Reply