Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Software | Box64 #4625

Merged
merged 5 commits into from
Sep 14, 2021
Merged

DietPi-Software | Box64 #4625

merged 5 commits into from
Sep 14, 2021

Conversation

ravenclaw900
Copy link
Collaborator

@ravenclaw900 ravenclaw900 commented Aug 6, 2021

Status: Testing

  • Test on RPi Aarch64
  • Test on PBP

Reference: #3957

Commit list/description:

  • DietPi-Software | Begin to add Box64

@ravenclaw900 ravenclaw900 added this to the v7.5 milestone Aug 6, 2021
@ravenclaw900 ravenclaw900 self-assigned this Aug 6, 2021
@ravenclaw900 ravenclaw900 linked an issue Aug 6, 2021 that may be closed by this pull request
@MichaIng
Copy link
Owner

MichaIng commented Aug 6, 2021

Oh, nice, didn't saw this coming. Coincidentally I stumbled above a Steam on RPi guide today and verified that it contains precisely the steps and hints we do and found. So nothing to update, so far.

So Box64 allows to run x86_64 software and related Steam games, that is awesome news.

@ravenclaw900
Copy link
Collaborator Author

ravenclaw900 commented Aug 14, 2021

@MichaIng, could you add a Steam package for ARMv8?

@ravenclaw900
Copy link
Collaborator Author

Ah, right, Steam is 32-bit.

@ravenclaw900 ravenclaw900 marked this pull request as ready for review August 16, 2021 13:31
@MichaIng
Copy link
Owner

Hmm, that's actually a problem. I mean I could pack an aarch64 package, but the /usr/lib/games/steam/steam binary stays i386 and the question is whether Box64 can execute it the same way a 64-bit CPU can execute 32-bit executables (being backwards-compatible)?

Actually I'm wondering why ARMv8 CPUs cannot execute Box86 🤔. For Steam, finally Box86 and Box64 both could be installed in parallel to run i386 and x86_64 binaries, and probably then 64-bit games through Steam.

@ravenclaw900
Copy link
Collaborator Author

I had trouble compiling the Box86 binary on ARMv8, though I didn't try to make any modifications.

Scanning dependencies of target PRINTER
Scanning dependencies of target WRAPPERS
Scanning dependencies of target dynarec_arm
[  0%] Built target PRINTER
[  0%] Building C object CMakeFiles/dynarec_arm.dir/src/dynarec/dynarec_arm.c.o
[  0%] Building C object CMakeFiles/dynarec_arm.dir/src/dynarec/dynablock.c.o
[  0%] Built target WRAPPERS
cc: error: unrecognized command-line option ‘-marm’
cc: error: unrecognized command-line option ‘-marm’
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/dynarec_arm.dir/build.make:82: CMakeFiles/dynarec_arm.dir/src/dynarec/dynablock.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[  1%] Building C object CMakeFiles/dynarec_arm.dir/src/dynarec/dynarec_arm_functions.c.o
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
cc: error: unrecognized command-line option ‘-marm’
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/dynarec_arm.dir/build.make:95: CMakeFiles/dynarec_arm.dir/src/dynarec/dynarec_arm.c.o] Error 1
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
[  1%] Building C object CMakeFiles/dynarec_arm.dir/src/dynarec/arm_printer.c.o
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/dynarec_arm.dir/build.make:108: CMakeFiles/dynarec_arm.dir/src/dynarec/dynarec_arm_functions.c.o] Error 1
cc: error: unrecognized command-line option ‘-marm’
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/dynarec_arm.dir/build.make:121: CMakeFiles/dynarec_arm.dir/src/dynarec/arm_printer.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:164: CMakeFiles/dynarec_arm.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Scanning dependencies of target arm_pass0
[  2%] Building C object CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_helper.c.o
Scanning dependencies of target arm_pass1
cc: error: unrecognized command-line option ‘-marm’
[  2%] Building C object CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_emit_tests.c.o
cc: error: unrecognized command-line option ‘-marm’
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
Scanning dependencies of target arm_pass2
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/arm_pass0.dir/build.make:82: CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_helper.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/arm_pass0.dir/build.make:95: CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_emit_tests.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:191: CMakeFiles/arm_pass0.dir/all] Error 2
[  2%] Building C object CMakeFiles/arm_pass1.dir/src/dynarec/dynarec_arm_helper.c.o
cc: error: unrecognized command-line option ‘-marm’
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/arm_pass1.dir/build.make:82: CMakeFiles/arm_pass1.dir/src/dynarec/dynarec_arm_helper.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[  3%] Building C object CMakeFiles/arm_pass1.dir/src/dynarec/dynarec_arm_emit_math.c.o
[  3%] Building C object CMakeFiles/arm_pass1.dir/src/dynarec/dynarec_arm_emit_tests.c.o
cc: error: unrecognized command-line option ‘-marm’
[  3%] Building C object CMakeFiles/arm_pass2.dir/src/dynarec/dynarec_arm_helper.c.o
cc: error: unrecognized command-line option ‘-marm’
cc: error: unrecognized command-line option ‘-marm’
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
[  4%] Building C object CMakeFiles/arm_pass2.dir/src/dynarec/dynarec_arm_emit_tests.c.o
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/arm_pass1.dir/build.make:95: CMakeFiles/arm_pass1.dir/src/dynarec/dynarec_arm_emit_tests.c.o] Error 1
cc: error: unrecognized command-line option ‘-marm’
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/arm_pass1.dir/build.make:108: CMakeFiles/arm_pass1.dir/src/dynarec/dynarec_arm_emit_math.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:249: CMakeFiles/arm_pass1.dir/all] Error 2
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/arm_pass2.dir/build.make:82: CMakeFiles/arm_pass2.dir/src/dynarec/dynarec_arm_helper.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/arm_pass2.dir/build.make:95: CMakeFiles/arm_pass2.dir/src/dynarec/dynarec_arm_emit_tests.c.o] Error 1
[  5%] Building C object CMakeFiles/arm_pass2.dir/src/dynarec/dynarec_arm_emit_logic.c.o
[  5%] Building C object CMakeFiles/arm_pass2.dir/src/dynarec/dynarec_arm_emit_math.c.o
cc: error: unrecognized command-line option ‘-marm’
cc: error: unrecognized command-line option ‘-marm’
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/arm_pass2.dir/build.make:121: CMakeFiles/arm_pass2.dir/src/dynarec/dynarec_arm_emit_logic.c.o] Error 1
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/arm_pass2.dir/build.make:108: CMakeFiles/arm_pass2.dir/src/dynarec/dynarec_arm_emit_math.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:359: CMakeFiles/arm_pass2.dir/all] Error 2
make: *** [Makefile:160: all] Error 2

@MichaIng
Copy link
Owner

Does Steam actually execute with Box64, when its i386? Didn't find time to test it yet.

@MichaIng MichaIng modified the milestones: v7.5, v7.6 Aug 20, 2021
@MichaIng
Copy link
Owner

I hope you're okay with postponing this to v7.6, so we have some time to test and get it running with Steam.

@ravenclaw900
Copy link
Collaborator Author

No problem.

+ DietPi-Software | Begin to add Box64
+ DietPi-Software | Allow Steam for aarch64
+ DietPi-Software | Fix software ID
+ DietPi-Software | Fix uninstall steps
@MichaIng
Copy link
Owner

MichaIng commented Sep 14, 2021

Builds fine on aarch64. One minor quirk is that despite we pass -DNOGIT=1:

[ 37%] Generating ../src/git_head.h
bash: line 1: git: command not found

But it does not break the build. -DNOGIT=1 and -DNOGIT=ON are 100% equivalent, aren't they? (yes it is)
Probably this flag is only about whether the source has been pulled via Git, not about whether Box64 itself will have Git support or not (for whatever is uses this)? Not sure, however, ignoring for now.

I packed aarch64 Steam packages. Now testing whether Box64 is i386 backwards-compatible like x86_64 is. Box86 cannot build or run on aarch64, as of the README: https://github.com/ptitSeb/box86#compilinginstallation

You NEED a 32-bit subsystem to run and build Box86. Box86 is useless on 64-bit only systems. Also, you NEED a 32-bit toolchain to build Box86. A toolchain that only supports 64-bit will not compile Box86, and you'll get errors (typically on aarch64, you get "-marm" not recognized, and you'll need a multiarch or chroot environnement).

EDIT: Doesn't sound promising: https://github.com/ptitSeb/box64#notes-about-32-bit-platforms

Because Box64 works by directly translating function calls from x86_64 to host system, the host system (the one Box64 is running on) needs to have 64-bits libraries. Box64 doesn't include any 64-bits <-> 32-bits translation.

So understand that box64 will only runs 64bits linux binaries. For 32bits binaries, you need box86 (with all the multiarch or proot trickery it imply on 64bits OS). Note that many installer (mojo setup based) will fall back to "x86" when detecting ARM64 OS, and so will try to use box86 for the setup, even if an x86_64 version exist. You can hack your way around with a fake "uname" that return "x86_64" when argument is "-m"

So in combination I don't think that we'll get Steam on ARMv8 running soon. In theory it would work when we provided an armhf toolchain or a pre-compiled Box86 binary and all required shared libraries additionally as armhf versions. At least this is how I understand the statements.

@MichaIng
Copy link
Owner

# box64 /root/.steam/debian-installation/ubuntu12_32/steam
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL PageSize:4096
Box64 with Dynarec v0.1.4 nogit built on Sep 14 2021 19:06:35
Using default BOX64_LD_LIBRARY_PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/
Using default BOX64_PATH: ./:bin/
Counted 17 Env var
Looking for /root/.steam/debian-installation/ubuntu12_32/steam
steam detected, forcing emulated libudev
This is a 32bits ELF! box64 can only run 64bits ELF (/root/.steam/debian-installation/ubuntu12_32/steam)!
Error: reading elf header of /root/.steam/debian-installation/ubuntu12_32/steam, try to launch natively instead

+ DietPi-Software | Steam: Do not allow to install it with Box64 on ARMv8: It is an i386 binary and hence cannot be executed by Box64 and Box86 cannot be easily installed and run on ARMv8 either.
@MichaIng
Copy link
Owner

I'll merge. We can do further testing during remaining beta phase. I need to think about some good x86_64 binaries/software to test 🤔.

@MichaIng MichaIng merged commit c690a06 into dev Sep 14, 2021
@MichaIng MichaIng deleted the box64 branch September 14, 2021 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DietPi-Software | Box86 / Box64
2 participants