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

Missing symbols running AppImage on Asahi #1805

Closed calebwestaway closed 2 weeks ago

calebwestaway commented 3 weeks ago

Hi! As the title says, I'm trying to run an AppImage on Asahi Linux. Specifically (if it matters) Cider, an Apple Music client, which uses Electron

I first tried the box64-asahi package from the Fedora repos, but that kept throwing errors about a library libgcc_s.so.1, which I couldn't resolve. After, I complied it myself with the options recommended on the docs for M1 -D M1=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo, and that had no such errors

I'm getting further now, but I still have issues. I haven't done any additional configuration past just installing, but I haven't found any options that could (as far as I can see) resolve it, although I don't know a whole lot about emulation like this. I'm doing all this on a Macbook Air M2 with Fedora Asahi Remix

Here's the full log:

$ box64 ~/Cider-linux-appimage-x64.AppImage 
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT PageSize:16384 Running on Blizzard-M2 Avalanche-M2 with 8 Cores
Will use Hardware counter measured at 24.0 MHz emulating 3.0 GHz
Params database has 89 entries
Box64 with Dynarec v0.3.1 75bdb328 built on Sep  7 2024 13:23:18
BOX64: Detected 48bits at least of address space
Counted 87 Env var
BOX64 LIB PATH: BOX64 BIN PATH: ./:bin/:/home/calebwestaway/.local/bin/:/home/calebwestaway/bin/:/usr/local/bin/:/usr/bin/:/bin/:/usr/local/sbin/:/usr/sbin/:/sbin/
Looking for /home/calebwestaway/Cider-linux-appimage-x64.AppImage
Rename process to "Cider-linux-appimage-x64.AppImage"
Using native(wrapped) libdl.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libz.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 native(wrapped) libfuse.so.2
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT PageSize:16384 Running on Blizzard-M2 Avalanche-M2 with 8 Cores
Will use Hardware counter measured at 24.0 MHz emulating 3.0 GHz
Params database has 89 entries
Box64 with Dynarec v0.3.1 75bdb328 built on Sep  7 2024 13:23:18
BOX64: Detected 48bits at least of address space
Counted 92 Env var
BOX64 LIB PATH: BOX64 BIN PATH: ./:bin/:/tmp/.mount_Cider-5IKban/:/tmp/.mount_Cider-5IKban/usr/sbin/:/home/calebwestaway/.local/bin/:/home/calebwestaway/bin/:/usr/local/bin/:/usr/bin/:/bin/:/usr/local/sbin/:/usr/sbin/:/sbin/
Looking for /tmp/.mount_Cider-5IKban/cider
Rename process to "cider"
Redirecting overridden malloc from symtab function for /tmp/.mount_Cider-5IKban/cider
Using emulated /tmp/.mount_Cider-5IKban/libffmpeg.so
Using native(wrapped) libdl.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libgobject-2.0.so.0
Using native(wrapped) libglib-2.0.so.0
Using native(wrapped) libgio-2.0.so.0
Using native(wrapped) libgmodule-2.0.so.0
Using native(wrapped) libnss3.so
Using native(wrapped) libnssutil3.so
Using native(wrapped) libsmime3.so
Using native(wrapped) libnspr4.so
Using native(wrapped) libdbus-1.so.3
Using native(wrapped) libatk-1.0.so.0
Using native(wrapped) libatk-bridge-2.0.so.0
Using native(wrapped) libSM.so.6
Using native(wrapped) libICE.so.6
Using native(wrapped) libXau.so.6
Using native(wrapped) libxcb.so.1
Using native(wrapped) libXdmcp.so.6
Using native(wrapped) libcups.so.2
Using native(wrapped) libdrm.so.2
Using native(wrapped) libgtk-3.so.0
Using native(wrapped) libgdk-3.so.0
Using native(wrapped) libgdk_pixbuf-2.0.so.0
Using native(wrapped) libpangocairo-1.0.so.0
Using native(wrapped) libpango-1.0.so.0
Using native(wrapped) libcairo.so.2
Using native(wrapped) libX11.so.6
Using native(wrapped) libXcomposite.so.1
Using native(wrapped) libXdamage.so.1
Using native(wrapped) libXext.so.6
Using native(wrapped) libXfixes.so.3
Using native(wrapped) libXrandr.so.2
Using native(wrapped) libXrender.so.1
Using native(wrapped) libgbm.so.1
Using native(wrapped) libexpat.so.1
Using native(wrapped) libxkbcommon.so.0
Using native(wrapped) libasound.so.2
Using native(wrapped) libatspi.so.0
Using native(wrapped) libm.so.6
Using emulated /usr/lib/box64-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
Warning: Weak Symbol ZSTD_trace_decompress_begin not found, cannot apply R_X86_64_JUMP_SLOT @0x10a9eb170 (0xa446246)
Warning: Weak Symbol ZSTD_trace_decompress_end not found, cannot apply R_X86_64_JUMP_SLOT @0x10a9eb178 (0xa446256)
Warning: Weak Symbol _ZTHN2v88internal12trap_handler21g_thread_in_wasm_codeE not found, cannot apply R_X86_64_JUMP_SLOT @0x10a9eb808 (0xa446f76)
Warning: Weak Symbol _ZTHN2v88internal19RwxMemoryWriteScope31code_space_write_nesting_level_E not found, cannot apply R_X86_64_JUMP_SLOT @0x10a9eb810 (0xa446f86)
Warning: Weak Symbol OPENSSL_memory_alloc not found, cannot apply R_X86_64_JUMP_SLOT @0x10a9eba48 (0xa4473f6)
Warning: Weak Symbol OPENSSL_memory_free not found, cannot apply R_X86_64_JUMP_SLOT @0x10a9eba50 (0xa447406)
Warning: Weak Symbol sdallocx not found, cannot apply R_X86_64_JUMP_SLOT @0x10a9eba58 (0xa447416)
Warning: Weak Symbol OPENSSL_memory_get_size not found, cannot apply R_X86_64_JUMP_SLOT @0x10a9eba60 (0xa447426)
14147|BOX64: Warning, calling Signal 4 function handler SIG_DFL
Unhandled signal caught, aborting
NativeBT: /tmp/.mount_Cider-5IKban/cider() [0x34878010]
NativeBT: linux-vdso.so.1(__kernel_rt_sigreturn+0) [0xfffef0568800]
NativeBT: /lib64/libc.so.6(+0x987e0) [0xfffef03b87e0]
NativeBT: /lib64/libc.so.6(gsignal+0x20) [0xfffef0365a00]
NativeBT: /lib64/libc.so.6(abort+0xf8) [0xfffef0350288]
NativeBT: /tmp/.mount_Cider-5IKban/cider() [0x3487335c]
NativeBT: /tmp/.mount_Cider-5IKban/cider() [0x3487686c]
NativeBT: /tmp/.mount_Cider-5IKban/cider() [0x34878ef4]
NativeBT: /tmp/.mount_Cider-5IKban/cider() [0x351aa010]
NativeBT: [0xfffeeaaa0c3c]
EmulatedBT: /tmp/.mount_Cider-5IKban/cider+5de1e90 [0x105de1e90]
EmulatedBT: /tmp/.mount_Cider-5IKban/cider+5de4217 [0x105de4217]
EmulatedBT: /tmp/.mount_Cider-5IKban/cider+5df5bd1 [0x105df5bd1]
EmulatedBT: /tmp/.mount_Cider-5IKban/cider(_Znwm+1f) [0x105df511f]
EmulatedBT: /tmp/.mount_Cider-5IKban/cider+5d3043d [0x105d3043d]
EmulatedBT: /tmp/.mount_Cider-5IKban/cider+5d932aa [0x105d932aa]
EmulatedBT: /tmp/.mount_Cider-5IKban/cider+5d931d4 [0x105d931d4]
EmulatedBT: /tmp/.mount_Cider-5IKban/cider+248e001 [0x10248e001]
EmulatedBT: /tmp/.mount_Cider-5IKban/cider(__libc_csu_init+45) [0x1023f4195]
EmulatedBT: box64(ExitEmulation+0) [0x10080]
EmulatedBT: /tmp/.mount_Cider-5IKban/cider(+2a) [0x10205202a]
14147|SIGABRT @0xfffef03b87e0 (???(/lib64/libc.so.6+0x987e0)) (x64pc=0x105de1e90/"/tmp/.mount_Cider-5IKban/cider + 0x5de1e90", rsp=0xfffef00659f8, stack=0xfffeef868000:0xfffef0068000 own=(nil) fp=0xfffef00663c0), for accessing 0x3e800003743 (code=-6/prot=0), db=(nil)((nil):(nil)/(nil):(nil)/???:clean, hash:0/0) handler=(nil)
RSP-0x20:0x0000000000000000 RSP-0x18:0x0000000000000000 RSP-0x10:0x0000000000000000 RSP-0x08:0x0000000000000000
RSP+0x00:0x0000000000000000 RSP+0x08:0x0000000000000000 RSP+0x10:0x0000000000000000 RSP+0x18:0x0000000000000002
RAX:0x0000000000000016 RCX:0x0000000000000000 RDX:0x0000fffef0528760 RBX:0x0000000000001000 
RSP:0x0000fffef00659f8 RBP:0x0000fffef00663c0 RSI:0x0000fffef0350f60 RDI:0x0000fffef0066394 
 R8:0x0000000000000000  R9:0x0000000000000001 R10:0x0000000000000001 R11:0x0000000000000010 
R12:0x0000000000000003 R13:0x0000000000000000 R14:0x0000000000000003 R15:0x00003f5c00201000 
ES:0x002b CS:0x0033 SS:0x002b DS:0x002b FS:0x0043 GS:0x0053 
Aborted (core dumped)

Thanks in advance for any help!

ptitSeb commented 2 weeks ago

Those missing symbol are not the cause of the issue. They are weak symbol, so optional, and use for debugging...

The issue is that the program simple abort (that signal 4 near the end), probably because the pagesage is 16K and the program needs 4k. Solution for now would be to use the krun microvm to provide a 4k ppagesize environnement.

There might be improvments in 4k page size simulation of box64 later, but not even sure this simulation will be enough for this kind of program anyway.

calebwestaway commented 2 weeks ago

Oh okay, I'll look into krun. Thanks for the quick reply