box64 icon indicating copy to clipboard operation
box64 copied to clipboard

Box64 doesn't install all libraries in /lib64/ on Asahi Linux

Open Ssp29-93 opened this issue 1 year ago • 5 comments

Hi,

I installed box64 (I tried both dnf and compiling) on my M1 Macbook and there are several x86 binaries that I'm unable to launch via box64.

The typical error is :

qemu-x86_64-static: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

I've read that ld-linux-x86-64.so.2 should be already installed according to https://box86.org/ . I also didn't figured out how to install it by myself bc I'm new to Fedora. I've tried installing the rpm files by hand (didn't worked) and also manually putting the library in /lib64/ (didn't worked either, telling me about some ELF errors while running a program which necessitate this lib)

You can reproduce the issue with the https://slippi.gg/ appimage for example

PS : some apps work great like FreeCAD for ex

Thx for your help and this amazing project !

Ssp29-93 avatar Mar 01 '24 00:03 Ssp29-93

you realize that you are launching qemu and not box64 here?

ptitSeb avatar Mar 01 '24 07:03 ptitSeb

Idk why I have this qemu error :fearful:

I also tried scilab this morning after decompressing their tar.gz

This is the complete error message if it can help

[quentin@~/Documents/scilab-6.1.1/bin] >> box64 ./scilab Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT PageSize:16384 Running on Icestorm-M1 Firestorm-M1 with 8 Cores Params database has 48 entries Box64 with Dynarec v0.2.7 19be6b5e built on Mar 1 2024 00:13:47 BOX64: Detected 48bits at least of address space Counted 47 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/quentin/.cargo/bin/:/home/quentin/.local/bin/:/home/quentin/bin/:/usr/lib64/ccache/:/usr/local/bin/:/usr/local/sbin/:/usr/bin/:/usr/sbin/:/var/lib/snapd/snap/bin/ Looking for ./scilab Not an ELF file (sign=#!/b) Error: Reading elf header of /home/quentin/Documents/scilab-6.1.1/bin/scilab, Try to launch natively instead Could not find the Java configuration for the model . Please contact us on http://bugzilla.scilab.org grep: avertissement : \ surnuméraire avant - qemu-x86_64-static: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

Ssp29-93 avatar Mar 01 '24 10:03 Ssp29-93

It's still running quemu in the end: the "binary" your are luanching is a shell script, so box64 cannot run it and use system bash to launch it, wich will launch the x86-64 binary that will use qemu on your system. binfmt integration... You ave both box64 and qemu on you system both wanting to execte x86_64 binary, and qemu runs.

do you need qemu-static-x86_64 ? if not, just remove it if you it, you can define BOX64_BASH to set the path of the bash from the tests folder of box64, it's a x64_86 version of it, and box64 can use this to launch script file and stay in box64 world...

ptitSeb avatar Mar 01 '24 13:03 ptitSeb

It worked ! Thanks !

However I'm still running on other issues with missing libraries : Error loading needed lib libgcc_s.so.1

I've read that libgcc_s should came out of the box with box64 so I'm a bit perplex (and idk how to install it on fedora otherwise)

Below is what my terminal returns to me while trying to execute scilab :

scilab_error.txt

Ssp29-93 avatar Mar 01 '24 15:03 Ssp29-93

Something like this:

sudo btrfs subvolume create /x86_64
sudo mkdir -p /x86_64/etc/yum.repos.d
sudo cp /etc/yum.repos.d/{fedora,fedora-updates,fedora-updates-testing}.repo /x86_64/etc/yum.repos.d/
sudo dnf --installroot=/x86_64 --forcearch=x86_64 --releasever=/ install system-release
sudo dnf --installroot=/x86_64 --forcearch=x86_64 install bash glibc

And save this as ~/.local/bin/box64:

#!/bin/sh
BOX64=/usr/bin/box64

export BOX64_LD_LIBRARY_PATH=./:lib/:lib64/:x86_64/:bin64/:libs64/:/x86_64/usr/lib64/
export BOX64_PATH=./:bin/:/x86_64/usr/bin/
export BOX64_BASH=/x86_64/usr/bin/bash

exec "$BOX64" "$@"

Then chmod +x ~/.local/bin/box64.

teohhanhui avatar May 22 '24 06:05 teohhanhui

We're working on a new project to help automatically install dependencies such as this. For now, Box64 appears to be working and a solution has been provided to download the needed x86_64 libraries. Closing as resolved.

LukeShortCloud avatar Nov 03 '24 14:11 LukeShortCloud