ptitSeb / box64

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

After building wine wow64, I started it in box64 but encountered the following error #1396

Open 1918057287 opened 7 months ago

1918057287 commented 7 months ago

user@localhost:~/Desktop$ box64 wine winencf Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT PageSize:4096 Running on Unknown CPU with 8 Cores Will use Hardware counter measured at 19.2 MHz emulating 614 MHz Params database has 61 entries Box64 with Dynarec v0.2.7 68d710cd built on Mar 31 2024 17:24:37 BOX64: Wine64 detected, WINEPRELOADRESERVE="" BOX64: Didn't detect 48bits of address space, considering it's 39bits Counted 32 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/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/games/:/usr/local/games/:/snap/bin/ Looking for wine Apply RC params for wine Applying BOX64_MAXCPU=64 argv[1]="winencf" Not an x86_64 ELF (183) Error: Reading elf header of /usr/local/bin/wine, Try to launch natively instead wine: created the configuration directory '/home/user/.wine' wine: failed to open L"C:\windows\system32\wineboot.exe": c0000135 0024:err:environ:run_wineboot failed to start wineboot c0000135 wine: failed to load start.exe: c0000135

1918057287 commented 7 months ago

Commands used to build ./configure --prefix=/usr/local --enable-archs=i386,x86_64

1918057287 commented 7 months ago

on termux chroot ubuntu

1918057287 commented 7 months ago

git clone https://gitlab.winehq.org/wine/wine.git ~/wine-dirs/wine-source

ptitSeb commented 7 months ago

is your wine binary an elf or a bash script? Can you use file on it to check?

(if it's a shell script, you need to set up BOX64_BASH to point to a x86_64 version of bash, like for example the one inside tests folder of box64 repo).

1918057287 commented 7 months ago

你的Wine二进制文件是elf还是bash脚本?你可以用file它来检查吗?

(如果是shell脚本,则需要设置BOX64_BASH为指向x86_64版本的bash,例如testsbox64 repo的内部文件夹)。

I can't even find his binary

ptitSeb commented 7 months ago

if you don't have binfmt support, it will not find x86_64 binary yes. I can't help you to setup binfmt on termux, you'll have to ask on some termux help channels.

RossComputerGuy commented 5 months ago

I am able to reproduce this problem on NixOS 24.05 (w/ Asahi stuff, M1 Pro) on the latest commit (2970ed5bfd1d418573613077880af1bd379d3d61). I have binfmt set up.

Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT PageSize:16384 Running on Unknown CPU with 10 Cores
Will use Hardware counter measured at 24.0 MHz emulating 3.0 GHz
Params database has 14 entries
Box64 with Dynarec v0.2.9 nogit built on Jan  1 1980 00:00:00
BOX64: Detected 48bits at least of address space
Counted 82 Env var
BOX64 LIB PATH: /nix/store/86zx04zbngd4skkrxfd5ndhx8f6ap24v-pipewire-1.0.6-jack/lib/:./:lib/:lib64/:x86_64/:bin64/:libs64/
BOX64 BIN PATH: ./:bin/:/nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/bin/:/run/wrappers/bin/:/home/ross/.local/share/flatpak/exports/bin/:/var/lib/flatpak/exports/bin/:/home/ross/.nix-profile/bin/:/nix/profile/bin/:/home/ross/.local/state/nix/profile/bin/:/etc/profiles/per-user/ross/bin/:/nix/var/nix/profiles/default/bin/:/run/current-system/sw/bin/:/nix/store/5mal6aa0s9fxnqibmybkz19bxh8scig2-gcc-wrapper-13.2.0/bin/:/nix/store/5pfllkhmmdrwi5z1da1009lx128kfbbq-binutils-wrapper-2.41/bin/:/nix/store/xyg13851ggmvasxadqxk6l3cyqgaff2n-pciutils-3.12.0/bin/:/nix/store/nppl7x028hckyrmba7q8w8pn0b7rf1kr-pkgconf-wrapper-2.1.1/bin/
Looking for /nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/bin/.wine
argv[1]="/nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/bin/.wine"
argv[2]="SteamSetup.exe"
Rename process to ".wine"
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libdl.so.2
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Using emulated /nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/bin/../lib/wine/x86_64-unix/ntdll.so
Using emulated /nix/store/r2jjxkphbxfyrawn8qvyc6r2wrkyvjwn-libunwind-1.8.1/lib/libunwind.so.8
Using emulated /nix/store/xvzz97yk73hw03v5dhhz3j47ggwf1yq1-gcc-13.2.0-lib/lib/libgcc_s.so.1
Error initializing native liblzma.so.5 (last dlerror is liblzma.so.5: cannot open shared object file: No such file or directory)
Using emulated /nix/store/lphbn1va4i43fj7f3m9xskf9y86khzf3-xz-5.4.6/lib/liblzma.so.5
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT PageSize:16384 Running on Unknown CPU with 10 Cores
Will use Hardware counter measured at 24.0 MHz emulating 3.0 GHz
Params database has 14 entries
Box64 with Dynarec v0.2.9 nogit built on Jan  1 1980 00:00:00
BOX64: Wine preloader detected, loading "/nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/bin/.wine" directly
BOX64: Detected 48bits at least of address space
Counted 83 Env var
BOX64 LIB PATH: /nix/store/86zx04zbngd4skkrxfd5ndhx8f6ap24v-pipewire-1.0.6-jack/lib/:./:lib/:lib64/:x86_64/:bin64/:libs64/
BOX64 BIN PATH: ./:bin/:/nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/bin/:/run/wrappers/bin/:/home/ross/.local/share/flatpak/exports/bin/:/var/lib/flatpak/exports/bin/:/home/ross/.nix-profile/bin/:/nix/profile/bin/:/home/ross/.local/state/nix/profile/bin/:/etc/profiles/per-user/ross/bin/:/nix/var/nix/profiles/default/bin/:/run/current-system/sw/bin/:/nix/store/5mal6aa0s9fxnqibmybkz19bxh8scig2-gcc-wrapper-13.2.0/bin/:/nix/store/5pfllkhmmdrwi5z1da1009lx128kfbbq-binutils-wrapper-2.41/bin/:/nix/store/xyg13851ggmvasxadqxk6l3cyqgaff2n-pciutils-3.12.0/bin/:/nix/store/nppl7x028hckyrmba7q8w8pn0b7rf1kr-pkgconf-wrapper-2.1.1/bin/
Looking for /nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/bin/.wine
argv[1]="/nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/bin/.wine"
argv[2]="SteamSetup.exe"
Rename process to ".wine"
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libdl.so.2
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Using emulated /nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/bin/../lib/wine/x86_64-unix/ntdll.so
Using emulated /nix/store/r2jjxkphbxfyrawn8qvyc6r2wrkyvjwn-libunwind-1.8.1/lib/libunwind.so.8
Using emulated /nix/store/xvzz97yk73hw03v5dhhz3j47ggwf1yq1-gcc-13.2.0-lib/lib/libgcc_s.so.1
Error initializing native liblzma.so.5 (last dlerror is liblzma.so.5: cannot open shared object file: No such file or directory)
Using emulated /nix/store/lphbn1va4i43fj7f3m9xskf9y86khzf3-xz-5.4.6/lib/liblzma.so.5
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT PageSize:16384 Running on Unknown CPU with 10 Cores
Will use Hardware counter measured at 24.0 MHz emulating 3.0 GHz
Params database has 14 entries
Box64 with Dynarec v0.2.9 nogit built on Jan  1 1980 00:00:00
BOX64: Detected 48bits at least of address space
Counted 83 Env var
BOX64 LIB PATH: /nix/store/86zx04zbngd4skkrxfd5ndhx8f6ap24v-pipewire-1.0.6-jack/lib/:./:lib/:lib64/:x86_64/:bin64/:libs64/
BOX64 BIN PATH: ./:bin/:/nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/bin/:/run/wrappers/bin/:/home/ross/.local/share/flatpak/exports/bin/:/var/lib/flatpak/exports/bin/:/home/ross/.nix-profile/bin/:/nix/profile/bin/:/home/ross/.local/state/nix/profile/bin/:/etc/profiles/per-user/ross/bin/:/nix/var/nix/profiles/default/bin/:/run/current-system/sw/bin/:/nix/store/5mal6aa0s9fxnqibmybkz19bxh8scig2-gcc-wrapper-13.2.0/bin/:/nix/store/5pfllkhmmdrwi5z1da1009lx128kfbbq-binutils-wrapper-2.41/bin/:/nix/store/xyg13851ggmvasxadqxk6l3cyqgaff2n-pciutils-3.12.0/bin/:/nix/store/nppl7x028hckyrmba7q8w8pn0b7rf1kr-pkgconf-wrapper-2.1.1/bin/
Looking for /nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/bin/wineserver
Rename process to "wineserver"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Using emulated /nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/lib/wine/x86_64-unix/libwine.so.1
wine: failed to start L"C:\\windows\\system32\\wineboot.exe"
0024:err:environ:run_wineboot failed to start wineboot c000007b
Warning: cannot create memory map (@0x7d000000 0x50b0) for elf "/home/ross/.wine/dosdevices/z:/nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/bin/.wine" got 0xffff2eae4000
Using emulated /home/ross/.wine/dosdevices/z:/nix/store/vp8cdpnvw6q79gvmr4jafdndvf4rk9hm-wine-wow64-wayland-8.2/bin/.wine
wine: failed to load start.exe: c000007b
ptitSeb commented 5 months ago

Issue is probably linked to this message: Warning: cannot create memory map (@0x7d000000 0x50b0) for elf "/home/ross/.wine/dosdevices/z:/nix/store/vp8cdpnvw6q79gvm That lead to wine: failed to load start.exe: c000007b

Can you run with BOX64_LOG=2 to have detail about what elfloader is doing? Issue seems to be elfloader that can't load the elf file correctly (side effect f the 16K pagesize probably).

RossComputerGuy commented 5 months ago

https://termbin.com/nsi6

ptitSeb commented 5 months ago

Oh wait. You are using 16k pagesize. Wine doesn't work yet on this configuration. Elfloader work, but not the PE loader of wine. I'll try to have some workaround later, but it's not done yet.

For now, you need to use a 4K pagesize for wine to work.

RossComputerGuy commented 5 months ago

For now, you need to use a 4K pagesize for wine to work.

4k page size kernel is broken for Asahi

ptitSeb commented 5 months ago

For now, you need to use a 4K pagesize for wine to work.

4k page size kernel is broken for Asahi

But 16k pagesize if broken for Wine. I'm working on some workaround. But for now, I'm focussing on AVX, and will go back to 16k pagesize later.

teohhanhui commented 5 months ago

4k page size kernel is broken for Asahi

@RossComputerGuy That's exactly what krun is for. (Yeah, I know you're having some trouble running it on NixOS.)