box64 icon indicating copy to clipboard operation
box64 copied to clipboard

GNU Hello

Open davidak opened this issue 3 years ago • 4 comments

I'm reviewing the PR for a Nix package (https://github.com/NixOS/nixpkgs/pull/173987).

I want to try to run box64 with the most simple program before any game, so i tried GNU hello, but that fails already. Is that program not supported or is there an issue with the packaging?

[nix-shell:~/.cache/nixpkgs-review/pr-173987-4]$ box64 -v
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL PageSize:4096
Box64 with Dynarec v0.1.8 nogit built on Jan  1 1980 00:00:00

# get x86_64-linux hello on aarch64-linux system
[root@pinephone:~]# nix-build 'https://github.com/NixOS/nixpkgs/archive/17c252aab1772d36acd6d3f57f6512f25b6f9e9c.tar.gz' --arg crossSystem '{ config = "x86_64-unknown-linux-gnu"; }' -A hello
these 2 paths will be fetched (6.15 MiB download, 29.72 MiB unpacked):
  /nix/store/bq5fvsivbfxn3gpqa4mbh318xlx64b86-glibc-x86_64-unknown-linux-gnu-2.34-115
  /nix/store/j3g94knvy76wzravskmzr4m3xfa5ghy5-hello-x86_64-unknown-linux-gnu-2.12
copying path '/nix/store/bq5fvsivbfxn3gpqa4mbh318xlx64b86-glibc-x86_64-unknown-linux-gnu-2.34-115' from 'https://cache.nixos.org'...
copying path '/nix/store/j3g94knvy76wzravskmzr4m3xfa5ghy5-hello-x86_64-unknown-linux-gnu-2.12' from 'https://cache.nixos.org'...
/nix/store/j3g94knvy76wzravskmzr4m3xfa5ghy5-hello-x86_64-unknown-linux-gnu-2.12

[nix-shell:~/.cache/nixpkgs-review/pr-173987-4]$ box64 /nix/store/j3g94knvy76wzravskmzr4m3xfa5ghy5-hello-x86_64-unknown-linux-gnu-2.12/bin/hello 
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL PageSize:4096
Box64 with Dynarec v0.1.8 nogit built on Jan  1 1980 00:00:00
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 109 Env var
Looking for /nix/store/j3g94knvy76wzravskmzr4m3xfa5ghy5-hello-x86_64-unknown-linux-gnu-2.12/bin/hello
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
Error: PltResolver: Symbol __wprintf_chk(ver 4: __wprintf_chk@GLIBC_2.4) not found, cannot apply R_X86_64_JUMP_SLOT 0x40cf78 (0x4022f6) in /nix/store/j3g94knvy76wzravskmzr4m3xfa5ghy5-hello-x86_64-unknown-linux-gnu-2.12/bin/hello
[nix-shell:~/.cache/nixpkgs-review/pr-173987-4]$ box64 /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/uptime 
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL PageSize:4096
Box64 with Dynarec v0.1.8 nogit built on Jan  1 1980 00:00:00
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 109 Env var
Looking for /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/uptime
Using emulated /nix/store/b0sshs1b8qvrvjijy4q7br48x8d0mkwq-acl-x86_64-unknown-linux-gnu-2.3.1/lib/libacl.so.1
Using emulated /nix/store/3r50lcc6dmfvcs9z5w1744jf55wdr0lf-attr-x86_64-unknown-linux-gnu-2.5.1/lib/libattr.so.1
Error initializing native libgmp.so.10 (last dlerror is libgmp.so.10: cannot open shared object file: No such file or directory)
Using emulated /nix/store/y2wbpqwhzjiihbs0ls0j9x8zx7yym1zk-gmp-with-cxx-x86_64-unknown-linux-gnu-6.2.1/lib/libgmp.so.10
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
Error: PltResolver: Symbol error(ver 2: error@GLIBC_2.2.5) not found, cannot apply R_X86_64_JUMP_SLOT 0x552c40 (0x408096) in /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/uptime
[nix-shell:~/.cache/nixpkgs-review/pr-173987-4]$ box64 /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/who
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL PageSize:4096
Box64 with Dynarec v0.1.8 nogit built on Jan  1 1980 00:00:00
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 109 Env var
Looking for /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/who
Using emulated /nix/store/b0sshs1b8qvrvjijy4q7br48x8d0mkwq-acl-x86_64-unknown-linux-gnu-2.3.1/lib/libacl.so.1
Using emulated /nix/store/3r50lcc6dmfvcs9z5w1744jf55wdr0lf-attr-x86_64-unknown-linux-gnu-2.5.1/lib/libattr.so.1
Error initializing native libgmp.so.10 (last dlerror is libgmp.so.10: cannot open shared object file: No such file or directory)
Using emulated /nix/store/y2wbpqwhzjiihbs0ls0j9x8zx7yym1zk-gmp-with-cxx-x86_64-unknown-linux-gnu-6.2.1/lib/libgmp.so.10
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
Error: PltResolver: Symbol stat(ver 16: stat@GLIBC_2.33) not found, cannot apply R_X86_64_JUMP_SLOT 0x552980 (0x407b16) in /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/who

These work:

[nix-shell:~/.cache/nixpkgs-review/pr-173987-4]$ box64 /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/echo test
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL PageSize:4096
Box64 with Dynarec v0.1.8 nogit built on Jan  1 1980 00:00:00
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 109 Env var
Looking for /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/echo
argv[1]="test"
Using emulated /nix/store/b0sshs1b8qvrvjijy4q7br48x8d0mkwq-acl-x86_64-unknown-linux-gnu-2.3.1/lib/libacl.so.1
Using emulated /nix/store/3r50lcc6dmfvcs9z5w1744jf55wdr0lf-attr-x86_64-unknown-linux-gnu-2.5.1/lib/libattr.so.1
Error initializing native libgmp.so.10 (last dlerror is libgmp.so.10: cannot open shared object file: No such file or directory)
Using emulated /nix/store/y2wbpqwhzjiihbs0ls0j9x8zx7yym1zk-gmp-with-cxx-x86_64-unknown-linux-gnu-6.2.1/lib/libgmp.so.10
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
test
[nix-shell:~/.cache/nixpkgs-review/pr-173987-4]$ box64 /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/mktemp
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL PageSize:4096
Box64 with Dynarec v0.1.8 nogit built on Jan  1 1980 00:00:00
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 109 Env var
Looking for /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/mktemp
Using emulated /nix/store/b0sshs1b8qvrvjijy4q7br48x8d0mkwq-acl-x86_64-unknown-linux-gnu-2.3.1/lib/libacl.so.1
Using emulated /nix/store/3r50lcc6dmfvcs9z5w1744jf55wdr0lf-attr-x86_64-unknown-linux-gnu-2.5.1/lib/libattr.so.1
Error initializing native libgmp.so.10 (last dlerror is libgmp.so.10: cannot open shared object file: No such file or directory)
Using emulated /nix/store/y2wbpqwhzjiihbs0ls0j9x8zx7yym1zk-gmp-with-cxx-x86_64-unknown-linux-gnu-6.2.1/lib/libgmp.so.10
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
/tmp/tmp.701c0tWJp8
[nix-shell:~/.cache/nixpkgs-review/pr-173987-4]$ box64 /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/uname -a
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL PageSize:4096
Box64 with Dynarec v0.1.8 nogit built on Jan  1 1980 00:00:00
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 109 Env var
Looking for /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/uname
argv[1]="-a"
Using emulated /nix/store/b0sshs1b8qvrvjijy4q7br48x8d0mkwq-acl-x86_64-unknown-linux-gnu-2.3.1/lib/libacl.so.1
Using emulated /nix/store/3r50lcc6dmfvcs9z5w1744jf55wdr0lf-attr-x86_64-unknown-linux-gnu-2.5.1/lib/libattr.so.1
Error initializing native libgmp.so.10 (last dlerror is libgmp.so.10: cannot open shared object file: No such file or directory)
Using emulated /nix/store/y2wbpqwhzjiihbs0ls0j9x8zx7yym1zk-gmp-with-cxx-x86_64-unknown-linux-gnu-6.2.1/lib/libgmp.so.10
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
Linux pinephone 5.17.5 #1-mobile-nixos SMP Tue Jan 1 00:00:00 UTC 1980 x86_64 GNU/Linux
[nix-shell:~/.cache/nixpkgs-review/pr-173987-4]$ box64 /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/whoami 
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL PageSize:4096
Box64 with Dynarec v0.1.8 nogit built on Jan  1 1980 00:00:00
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 109 Env var
Looking for /nix/store/zagsmdwhrmnbnp23vgrzg1nq0w5mvmmc-coreutils-x86_64-unknown-linux-gnu-9.0/bin/whoami
Using emulated /nix/store/b0sshs1b8qvrvjijy4q7br48x8d0mkwq-acl-x86_64-unknown-linux-gnu-2.3.1/lib/libacl.so.1
Using emulated /nix/store/3r50lcc6dmfvcs9z5w1744jf55wdr0lf-attr-x86_64-unknown-linux-gnu-2.5.1/lib/libattr.so.1
Error initializing native libgmp.so.10 (last dlerror is libgmp.so.10: cannot open shared object file: No such file or directory)
Using emulated /nix/store/y2wbpqwhzjiihbs0ls0j9x8zx7yym1zk-gmp-with-cxx-x86_64-unknown-linux-gnu-6.2.1/lib/libgmp.so.10
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) librt.so.1
davidak

davidak avatar May 23 '22 03:05 davidak

GNU Hello needs __wprintf_chk to be wrapped. I'll add it later. the 2 other program needs error and stat. That last one as already been added in current dev. version of box64.

(note that box64/box86 are targetted on games, and doesn't need a chroot to run, so gnu tools are not part of regular testing)

ptitSeb avatar May 23 '22 05:05 ptitSeb

hello is easier to obtain than some game, so i tested that first.

what do you recommend to run for a quick test of the package?

davidak avatar May 23 '22 05:05 davidak

Games that are know to work well: FTL or SuperMeatBoy. If you want easier to find game, you can try DwarfFortress (or AsciiSector) also. You can check the compatibility list also: https://box86.org/app/

ptitSeb avatar May 23 '22 06:05 ptitSeb

So, is it working now? Can the ticket be closed?

ptitSeb avatar Jul 03 '22 09:07 ptitSeb