M-HT / SR

A project to statically recompile following games to create Windows or Linux (x86 or arm) versions of the games - Albion, X-Com: UFO Defense (UFO: Enemy Unknown), X-Com: Terror from the Deep, Warcraft: Orcs & Humans, Septerra Core: Legacy of the Creator, Battle Isle 3: Shadow of the Emperor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Aarch64 support?

vanfanel opened this issue · comments

Hi!

I would like to run Albion on the Raspberry Pi 400 using my minimal aarch64 system. Are there support plans for generating aarch64 binaries?

Thanks!

commented

I'm planning to look into it, but there's no timeline.

Generating code which uses 64-bit pointers, when the original code uses 32-bit pointers is not easy.

If ILP32 for AArch64 was usable (which it isn't), then generating binaries for it wouldn't be very difficult.

@vanfanel did you try running it using e.g. https://wiki.debian.org/Arm64ilp32Port or something similar? I understand that it requires custom kernel modification, but I'm still curious if it would be possible to run current binaries this way. (also, FWIW, weren't ILP32 already possible on AArch64? I guess the real-life usability @M-HT talks about is the problem here; I haven't tried it myself ever, so I'm only throwing stuff I've heard about around)

commented

@FyiurAmron you can't run 32-bit arm binaries on ILP32 for AArch64, you need to compile programs for this architecture. You can't compile Albion for it at the moment, but it wouldn't be difficult to add support for it - that means adding llasm version. Septerra Core has a llasm version, so it should be possible to compile it for ILP32 for AArch64.

As for ILP32 for AArch64 itself, it's my understanding that it was worked on a few years ago, but it's not usable on any distribution. If I'm wrong about it, anyone is free to correct me.

commented

Nothing new about aarch64 binaries, but I want to point out that as long as the CPU supports 32-bit mode (which Raspberry Pi 400 does) you can create a 32-bit chroot and run 32-bin binaries from there.

I also tried compiling a kernel with ILP32 enabled, but my Raspberry Pi didn't boot, so no progress in this direction either.

@M-HT The idea about a 32-bit chroot sounds very good indeed...
I guess a 32-bit chroot rootfs can live in a directory inside the 64-bit (aarch64) system, right?
Then, after booting in aarch64 mode as I normally do, I would have to chroot into the 32-bit system and run the games... Am I right on this? If that's the case, it seems like a very nice experiment to do at home! :)

commented

@vanfanel Yes, that's how it works. When I tested it, I took some inspiration from this tutorial - it's not the best way to create chroot, so I didn't follow it exactly.

Multiarch is another option. Did you tested to compile anyone @vanfanel ohh, you are the sdl2 guy.

commented

I added support for generating 64-bit (x64, arm64) Linux version of Albion executable.
It's still experimental, but should be usable.

commented

I added x64 and arm64 versions of Albion and Septerra Core to the Releases.