Emulate NaCl with box64 for unsupported platforms#1946
Emulate NaCl with box64 for unsupported platforms#1946illwieckz merged 1 commit intoDaemonEngine:masterfrom
Conversation
|
Awesome! That is very good! I will probably try this on RISC-V at some point. 😎️ |
Yes, BE is dying. If you can make BE ppc64 running a native server that's more than enough for BE. If you can get LE ppc64 running with a compat layer for the nacl loader, that seems acceptable to me. It wouldn't be that different than a FreeBSD engine running the Linux NaCl loader, or the arm64 engine running the armhf NaCl loader… |
961fa07 to
dc4b999
Compare
5e531e5 to
27fa290
Compare
|
That's excellent! I modified a bit your patch on my side to make it work as well on riscv64, and I could load the client. Performance on riscv64 was so atrocious I couldn't join a server because it timed out, but the nexe code runs! |
27fa290 to
3fc41c9
Compare
I bet there are unoptimized codes on RV64 backend of box64, some opcodes might have fallen back to interpreter which is slow. What hardware are you using? |
|
@illwieckz I've just amended the PR to make it more generic |
3fc41c9 to
6b1f122
Compare
6b1f122 to
774f84f
Compare
illwieckz
left a comment
There was a problem hiding this comment.
That looks good to me for now.
We can improve over it later.
|
@runlevel5 please rename properly your commits (like removing the We don't request peoples to squash commits (we don't enforce 1 PR = 1 commit) and we in fact do appreciate detailed git history, but given this branch was an iterative work with some trials, you may have things you want to squash. 🙂️ Once you've tidied the history just tell me I'll merge the branch. Thank you very much for making the Dæmon engine and the Unvanquished game better ! |
Run x86_64 NaCl loader and amd64 .nexe game modules under Box64 emulation on platforms without native NaCl support. The native engine communicates with the emulated NaCl sandbox processes via architecture-independent Unix domain socket IPC, requiring no changes to game modules. - Add opt-in DAEMON_NACL_BOX64_EMULATION CMake option (OFF by default, Linux only) that remaps NACL_ARCH to amd64 - Replace architecture-specific NaCl dummy defines with a generic fallback for any unsupported architecture - Prepend box64 to NaCl loader args with PATH resolution - Skip bootstrap helper (incompatible with Box64 double-exec) - Disable platform qualification for emulated loader - Add cvars: vm.box64.path, workaround.box64.disableBootstrap, workaround.box64.disableQualification
17aec83 to
29514f0
Compare
For platform that does not support NaCl, it is feasible to use emulator like box64 to run the x86_64 NaCl version. There might be some edge cases that I am not aware of, however for most common paths I could verify the game load and join online game successfully.
NOTE: this works with architecture that supports LE, that is Little Endian because it will share the same structs. To be honest I would not care about BE because box64 does NOT support BE at all. Plus BE platform like PPC64 BE is dying as IBM has been pushing hard on LE solely.
Demo video: https://youtu.be/kwo_nOYiiTI