mkxp-z / mkxp-z

Open-source cross-platform player for (some) RPG Maker XP / VX / VX Ace games. A very heavily modified fork of mkxp. RGSS on steroids with a stupid name.
https://github.com/mkxp-z/mkxp-z/wiki
GNU General Public License v2.0
140 stars 39 forks source link

Add cross-compile support for Linux/ARM and Linux/POWER targets #155

Closed Splendide-Imaginarius closed 5 months ago

Splendide-Imaginarius commented 5 months ago

This PR adds cross-compile support to the Linux Makefile, and adds CI binaries accordingly.

Currently we support:

The following targets are also included, but are marked as "experimental" (meaning they won't fail the CI build [1]; fixing them can be a follow-up PR):

In the future, we could possibly add S390X since Ubuntu also supports it (I don't know if it will hit bugs since it's BE, unlike the other targets). We could also possibly add other targets that are supported by Debian Ports (e.g. MIPS or POWER BE), but those are trickier because they only exist in Debian Sid, which means we'd have to run the build inside a Sid container, and the Sid glibc would presumably impose rather stringent constraints on where you could run the resulting binaries. Maybe the glibc issue could be worked around by using Debian Snapshot, I'm not sure. We could also maybe add i386; I didn't do it just because I imagine the procedure for doing this is very different from the other cross-compile targets (since x86 has multilib). We could also maybe add x86_64 as a cross-compile target (e.g. if you want to build x86_64 binaries from an ARM64 build machine); I didn't do it because it seemed more niche and can be saved for a follow-up PR.

Cross-compiling for Windows or macOS targets is out of scope for this PR; I personally have no interest in spending time on it, but I'd be happy to take a PR if someone else wants to do it.

[1] The build status on the main PR page will incorrectly say the build failed due to this GitHub bug, but the Actions status page will correctly say the build succeeded. Direct your complaints to GitHub, not me.

Splendide-Imaginarius commented 5 months ago

These binaries worked fine on the hardware that was easily accessible for me to test. Whatever bugs remain can be fixed in a follow-up PR. Planning to merge this in a few days unless anyone reports some kind of highly egregious regression.