Page 1 of 1

Porting to aarch64

Posted: Sun Feb 16, 2025 10:43 am
by blowkj
I'm interested in running oolite on a pi4/5 which are aarch64. I looked at various options:

porting the ARMv6 assembler code from the current spidermonkey: this looks too complicated for me as the whole jit infrastructure has been reworked.

changing oolite javascript to the current api: this is what I think I can do with some help.

Since I'm not a developer, I will need some help (hopefully not all the time). Here is an example question:

In the oolite code you sometimes use the return value of JS::ValueToBoolean. My question is what could cause it to return a value of false (failure to convert)? If I understand that I can probably work out how to rewrite the code in those cases. It's easy when the return value is not used.

Is anyone sufficiently supportive of me doing this and interested to help answer questions like these.

Thanks,
Keith

Re: Porting to aarch64

Posted: Sun Feb 16, 2025 11:28 am
by another_commander
Changing Oolite's JS to the current api is not only a huge task in itself, it will most likely result in invalidating all current OXPs using the Spidermonkey FF4 api for their scripting, as there are bound to be changes, deprecations and refactors between the FF4 and present apis. This is why the FF4 version of Spidermonkey was locked as the final scripting library version for Oolite.

You can still atempt it if you want of course, but even if you succeed chances are that you will not be able to make good use of it. Pretty much all OXPs will have to be re-written to conform to the current api.

Re: Porting to aarch64

Posted: Sun Feb 16, 2025 12:56 pm
by blowkj
Thanks, yes I know it's a big task just the ld failures reported were 1500+. What do you think the chances are of porting the ARM v8 compiler into the old spidermonkey version?
Keith

Re: Porting to aarch64

Posted: Sun Feb 16, 2025 1:12 pm
by another_commander
Can't tell what the chances would be, you will have to find out if you decide to give it a try. It's old, pre C++11 code we are talking about here anf that may work in your favour. We have the Oolite libjs actual source in the github repo if you want to have a closer look.

Regarding the latest libjs, even if you manage to fix all 1500+ linker errors, you will still have to adapt the interface between Oolite and libjs to the latest library revision (OOJavaScriptEngine.m is the interface/heart of the scripting engine).

Re: Porting to aarch64

Posted: Sun Feb 16, 2025 3:10 pm
by Cholmondely
blowkj wrote: Sun Feb 16, 2025 10:43 am
I'm interested

Keith
Welcome to the merry throng! All the best with the pernicious "Porting"!

Re: Porting to aarch64

Posted: Mon Feb 17, 2025 10:37 pm
by blowkj
another_commander wrote: Sun Feb 16, 2025 1:12 pm
We have the Oolite libjs actual source in the github repo if you want to have a closer look.
Yes I already have that as well as the latest code. I had forgotten about the OXPs so thanks for pointing that out. I think I'll look at bringing in the v8 compiler. I'll need to understand better how the jit/wtf/assembler code works together.

Keith