ptitSeb / box64

Box64 - Linux Userspace x86_64 Emulator with a twist, targeted at ARM64 Linux devices
https://box86.org
MIT License
3.73k stars 267 forks source link

Stardew Valley not working on RPi 5 #1351

Closed kinzaye closed 6 months ago

kinzaye commented 6 months ago

Anticipating the release of the new Stardew patch I decided I would try and get it going on my Pi 5.

On previous Pis, all that had to be done was extract the linux installer, build box64, run the executable and off you go - eventually - but on the Pi 5 I get the following:

kyle@raspberrypi:~/Games/SDV/data/noarch/game $ ./StardewValley ./StardewValley: line 7: sw_vers: command not found PageSize:16384 Running on Cortex-A76 with 4 Cores Params database has 60 entries Box64 v0.2.7 33846405 built on Mar 10 2024 04:22:43 BOX64: Detected 48bits at least of address space Counted 50 Env var BOX64 LIB PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/ BOX64 BIN PATH: ./:bin/:/home/kyle/.local/bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/ Looking for ./Stardew Valley Rename process to "Stardew Valley" Using native(wrapped) libpthread.so.0 Using native(wrapped) libdl.so.2 Using emulated /lib/x86_64-linux-gnu/libstdc++.so.6 Using native(wrapped) libm.so.6 Using emulated /lib/x86_64-linux-gnu/libgcc_s.so.1 Using native(wrapped) libc.so.6 Using native(wrapped) ld-linux-x86-64.so.2 Using native(wrapped) libutil.so.1 Using native(wrapped) librt.so.1 Using native(wrapped) libbsd.so.0 Using emulated /home/kyle/Games/SDV/data/noarch/game/libhostfxr.so Using emulated /home/kyle/Games/SDV/data/noarch/game/libhostpolicy.so Using emulated /home/kyle/Games/SDV/data/noarch/game/libcoreclr.so Warning: Weak Symbol gmon_start not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff046a3650 (0x71e86) Warning: Weak Symbol _ZTH12t_ThreadType not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff046a36e8 (0x71fb6) Warning: Weak Symbol _ZTH27t_pStackWalkerWalkingThread not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff046a36f0 (0x71fc6) Warning: Weak Symbol _ZTHN9StressLog19t_pCurrentThreadLogE not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff046a3708 (0x71ff6) Warning: Weak Symbol _ZTH15t_CantStopCount not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff046a3710 (0x72006) Warning: Weak Symbol _ZTH16t_CantAllocCount not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff046a3778 (0x720d6) Using emulated /home/kyle/Games/SDV/data/noarch/game/libcoreclrtraceptprovider.so Error loading needed lib liblttng-ust.so.0 Error loading one of needed lib Error initializing needed lib /home/kyle/Games/SDV/data/noarch/game/libcoreclrtraceptprovider.so Error loading needed lib liblttng-ust-tracepoint.so.0 Warning: Cannot dlopen("liblttng-ust-tracepoint.so.0"/0x7fff04591e30, 102) Error loading needed lib liblttng-ust-tracepoint.so.0 Warning: Cannot dlopen("liblttng-ust-tracepoint.so.0"/0x7fff04591e30, 102) Using native(wrapped) libnuma.so Cannot create memory map (@0x7fff062f5000 0x38000/0xfff) for elf "/home/kyle/Games/SDV/data/noarch/game/libclrjit.so" error=22/Invalid argument Error: loading for elf /home/kyle/Games/SDV/data/noarch/game/libclrjit.so Fatal error. Failed to load JIT compiler NativeBT: ./Stardew Valley() [0x34a0c2f4] NativeBT: linux-vdso.so.1(kernel_rtsigreturn+0) [0x7fff1d14c7bc] NativeBT: /lib/aarch64-linux-gnu/libc.so.6(+0x80a10) [0x7fff1cfc0a10] NativeBT: /lib/aarch64-linux-gnu/libc.so.6(gsignal+0x1c) [0x7fff1cf7a76c] NativeBT: /lib/aarch64-linux-gnu/libc.so.6(abort+0xf0) [0x7fff1cf674bc] NativeBT: ./Stardew Valley() [0x34f61568] NativeBT: ./Stardew Valley() [0x349e5e30] NativeBT: ./Stardew Valley(mylibc_start_main+0x23c) [0x349fa9bc] NativeBT: ./Stardew Valley() [0x34a3aea0] NativeBT: ./Stardew Valley() [0x34f61568] NativeBT: ./Stardew Valley() [0x349e038c] NativeBT: /lib/aarch64-linux-gnu/libc.so.6(+0x27780) [0x7fff1cf67780] NativeBT: /lib/aarch64-linux-gnu/libc.so.6(__libc_start_main+0x98) [0x7fff1cf67858] NativeBT: ./Stardew Valley(_start+0x30) [0x349e0cf0] EmulatedBT: box64(abort+0) [0x50080] EmulatedBT: /home/kyle/Games/SDV/data/noarch/game/libcoreclr.so+4e582e [0x7fff044e582e] EmulatedBT: /home/kyle/Games/SDV/data/noarch/game/libcoreclr.so+4e577c [0x7fff044e577c] EmulatedBT: /home/kyle/Games/SDV/data/noarch/game/libcoreclr.so+1e3208 [0x7fff041e3208] EmulatedBT: ??? [0x7fff1ce6dfe0] EmulatedBT: ??? [(nil)] 4166|SIGABRT @0x7fff1cfc0a10 (???(/lib/aarch64-linux-gnu/libc.so.6+0x80a10)) (x64pc=0x50093/???:"box64/abort + 0x13", rsp=0x7fff1ce6d888), for accessing 0x3e800001046 (code=-6) RAX:0xb229bab891314800 RCX:0x0000000000000000 RDX:0x0000000000000000 RBX:0x0000000000000001 RSP:0x00007fff1ce6d888 RBP:0x00007fff1ce6d890 RSI:0x00007fff046e9968 RDI:0x0000000000000003 R8:0x00000000636a0670 R9:0x0000000000000000 R10:0xfffffffeffffffff R11:0x00000000636c1382 R12:0x0000000080131506 R13:0x00007fff0412298b R14:0x0000000080131506 R15:0x0000000000000000 ES:0x002b CS:0x0033 SS:0x002b DS:0x002b FS:0x0043 GS:0x0053 ./StardewValley: line 27: 4166 Aborted ./"Stardew Valley" $@

Built using the Pi 5 16K page options, but even with the regular Pi 5 build the result is the same.

Hopefully someone knows what is going wrong! Cheers.

ptitSeb commented 6 months ago

The issue is with the 16K pagesize. Box64 support for non-4K pagesize is still young and elfloader still have some issue. You can see Cannot create memory map (@0x7fff062f5000 0x38000/0xfff) for elf "/home/kyle/Games/SDV/data/noarch/game/libclrjit.so" error=22/Invalid argument that is a side effect of this. More work on non-4K pagesize is planned, but in the mean time, I suggest you switch to 4K pagesize (it's supposed to be as easy as change some number in a text file on PI5).

kinzaye commented 6 months ago

I changed the page size like you suggested and it seems to have solved the issue. Thanks!

For anyone playing along at home you can change the pi 5 page size by loading a different kernel. This is achieved easily by putting "kernel=kernel8.img" in your /boot/firmware/config.txt file! 😃