SR icon indicating copy to clipboard operation
SR copied to clipboard

Aarch64 support?

Open vanfanel opened this issue 4 years ago • 14 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!

vanfanel avatar Jan 18 '21 18:01 vanfanel

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.

M-HT avatar Jan 18 '21 21:01 M-HT

@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)

FyiurAmron avatar Jan 23 '21 15:01 FyiurAmron

@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.

M-HT avatar Jan 24 '21 09:01 M-HT

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 avatar Jun 06 '21 09:06 M-HT

@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! :)

vanfanel avatar Jul 02 '21 12:07 vanfanel

@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.

M-HT avatar Jul 02 '21 13:07 M-HT

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

neofeo avatar Aug 14 '21 05:08 neofeo

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

M-HT avatar Apr 23 '23 14:04 M-HT

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

M-HT avatar May 23 '23 09:05 M-HT