AndreRH / hangover

Hangover runs simple Win32 applications on arm64 Linux
GNU Lesser General Public License v2.1
1.24k stars 91 forks source link

RISC-V support #136

Open volkertb opened 1 year ago

volkertb commented 1 year ago

I'm frankly surprised that no one else has created an issue for this feature request yet.

Obviously, adding support for a different architecture is far from a trivial task, as we can see from the work that was needed (and continues to be needed?) to get it working with ppc64le.

But RISC-V is a promising architecture, and although not yet as ubiquitous as ARM, it's beginning to gain some serious industry traction. And with more affordable development hardware becoming available for it as well recently, perhaps it would be a good idea to start thinking about what would be needed for Hangover to allow 32-bit and 64-bit x86 applications to run on RISC-V hardware?

Thanks for considering.

OctopusET commented 1 year ago

I'm building hangover on my visionfive2 (riscv64) now. I changed arm to riscv32 when I build qemu. Build works for now but the problem is llvm-mingw. It doesn't support riscv64, what could be the solution for it?

AndreRH commented 1 year ago

Mostly RISC-V is in the same bucket as PPC64le. There's a distinction between unixlib based WoW64 (old wow64) and PE based WoW64 (new wow64). Hangover now only works with new wow64, so even if you port the unix side of Wine to RISC-V or PPC64le you can't have PE files loaded with the emulator in between. I still haven't investigated if that's a hard limitation or we could work around it. As with PPC64le there were already patches for RISC-V, I started the port in the Wine 3.x era, but there was no user interest back then so I stopped: https://github.com/AndreRH/wine/tree/riscv64 Supporting 64-bit x86 applications is currently another Hangover limitation and will likely be solved upstream for ARM64. One thing here I could imagine is that porting wow64.dll to w64ow64.dll (or whatever name suites best) might be a hacky general purpose solution. llvm-mingw is only used to build the PE parts of Wine, that could be solved by crosscompilation. The real problem is that Wine itself can't be build for RISC-V yet (see my old branch above).

All this won't happen in my spare time until:

But patches are welcome for those points:

AndreRH commented 7 months ago

So I think I'm happy enough now with the ARM64 solutions we have. And testing revealed it's possible to have PE-on-unixlib wow64, even without hacks. Though 64-bit applications likely won't be possible. I added https://throne.com/andrerh/item/b263322d-3c73-4423-90bc-34b5936d5efd and a RISC-V Patreon level: https://www.patreon.com/checkout/andre_opensource?rid=10905632

volkertb commented 7 months ago

@AndreRH Please check your direct messages on Patreon. Thanks! :slightly_smiling_face:

volkertb commented 7 months ago

@AndreRH Have you seen this yet? https://www.phoronix.com/news/Milk-V-Oasis

There is currently a discount offer for pre-orders, but shipping won't be expected until 10 months from now.

Stil, it looks like an interesting (additional) development platform to keep an eye on.