ptitSeb / box86

Box86 - Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices
https://box86.org
MIT License
3.28k stars 226 forks source link

building on rk3588s #940

Open nongze opened 6 months ago

nongze commented 6 months ago
orangepi@orangepi5:~/box86/build$ cmake .. -DRK3588=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
-- Configuring done
-- Generating done
-- Build files have been written to: /home/orangepi/box86/build
orangepi@orangepi5:~/box86/build$ make -j7
Scanning dependencies of target dynarec_arm
[  0%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x86run.c.o
[  1%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x86run0f.c.o
[  1%] Building C object CMakeFiles/test_interpreter.dir/src/emu/x86run64.c.o
[  1%] Built target PRINTER
[  1%] Building C object CMakeFiles/interpreter.dir/src/emu/x86run.c.o
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’
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/test_interpreter.dir/build.make:76:CMakeFiles/test_interpreter.dir/src/emu/x86run.c.o] error 1
make[2]: *** 正在等待未完成的任务(en:Waiting for unfinished tasks)....
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
make[2]: *** [CMakeFiles/test_interpreter.dir/build.make:104:CMakeFiles/test_interpreter.dir/src/emu/x86run64.c.o] error 1
[  1%] Building C object CMakeFiles/interpreter.dir/src/emu/x86run0f.c.o
[  1%] Built target WRAPPERS
[  1%] Building C object CMakeFiles/dynarec_arm.dir/src/dynarec/dynablock.c.o
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/interpreter.dir/build.make:76:CMakeFiles/interpreter.dir/src/emu/x86run.c.o] error1
make[2]: *** 正在等待未完成的任务(Waiting for unfinished tasks)....
[  1%] Building C object CMakeFiles/interpreter.dir/src/emu/x86run64.c.o
[  2%] Building C object CMakeFiles/interpreter.dir/src/emu/x86run640f.c.o
[  2%] Building C object CMakeFiles/interpreter.dir/src/emu/x86run6466.c.o
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 ‘-mfpu=neon-fp-armv8’
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
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:76:CMakeFiles/dynarec_arm.dir/src/dynarec/dynablock.c.o] error1
make[2]: *** [CMakeFiles/interpreter.dir/build.make:104:CMakeFiles/interpreter.dir/src/emu/x86run64.c.o] error 1
make[1]: *** [CMakeFiles/Makefile2:154:CMakeFiles/dynarec_arm.dir/all] error 2
make[1]: *** 正在等待未完成的任务(Waiting for unfinished tasks)....
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/test_interpreter.dir/build.make:90:CMakeFiles/test_interpreter.dir/src/emu/x86run0f.c.o] error 1
[  3%] Building C object CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_emit_tests.c.o
make[1]: *** [CMakeFiles/Makefile2:284:CMakeFiles/test_interpreter.dir/all] error 2
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/interpreter.dir/build.make:132:CMakeFiles/interpreter.dir/src/emu/x86run6466.c.o] error 1
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
[  3%] Building C object CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_emit_math.c.o
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/interpreter.dir/build.make:90:CMakeFiles/interpreter.dir/src/emu/x86run0f.c.o] error1
[  3%] Building C object CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_emit_shift.c.o
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
[  3%] Building C object CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_helper.c.o
[  4%] Building C object CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_pass.c.o
[  4%] Building C object CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_emit_logic.c.o
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
make[2]: *** [CMakeFiles/interpreter.dir/build.make:118:CMakeFiles/interpreter.dir/src/emu/x86run640f.c.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:341:CMakeFiles/interpreter.dir/all] 错误 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_pass0.dir/build.make:104:CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_emit_math.c.o] 错误 1
make[2]: *** 正在等待未完成的任务(Waiting for unfinished tasks)....
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:132:CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_emit_shift.c.o] error 1
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/arm_pass0.dir/build.make:146:CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_pass.c.o] 错误 1
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
[  4%] Building C object CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_00.c.o
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/arm_pass0.dir/build.make:90:CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_emit_tests.c.o] 错误 1
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 ‘-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:76:CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_helper.c.o] 错误 1
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/arm_pass0.dir/build.make:160:CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_00.c.o] 错误 1
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-marm’
make[2]: *** [CMakeFiles/arm_pass0.dir/build.make:118:CMakeFiles/arm_pass0.dir/src/dynarec/dynarec_arm_emit_logic.c.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:180:CMakeFiles/arm_pass0.dir/all] 错误 2
make: *** [Makefile:166:all] 错误 2

What can I do? I'm trying to do this.

sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install build-essential git cmake gcc-arm-linux-gnueabihf libc6-dev-armhf-cross libappindicator1 libnm0 libtcmalloc-minimal4 liblttng-ust-dev libcairo2:armhf libgmp10:armhf libvulkan1:armhf libudev-dev:armhf -y

But it doesn't work.

ptitSeb commented 6 months ago

You should remove the build folder and start again. It seems cmake didn't use gcc-arm-linux-gnuarmhf to make the build but regular gcc (so 64bits). Try again from a clean build folder. If it still doesn't work, install cmake-curse-gui, then use ccmake . from the build folder to use an interactive version of cmake. Use t to go to advanced mode and change the compiler to gcc-arm-linux-gnuarmhf, than 'c' a couple of time to re-configure everything and 'g' to generate makefile.

nongze commented 6 months ago

I found that I can directly install the deb package. Is this feasible?

sudo wget https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -O /etc/apt/sources.list.d/box86.list
wget -qO- https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg
sudo apt update && sudo apt install box86 -y
ptitSeb commented 6 months ago

You can install the deb package if you prefer yes.

nongze commented 6 months ago

Then how should I install Steam? There are many dependency issues, and sh scripts are not effective

ptitSeb commented 6 months ago

what dependancy issue?

nongze commented 6 months ago
E: 无法定位软件包 libsdl2-2.0-0:armhf
E: 无法按照 glob ‘libsdl2-2.0-0’ 找到任何软件包
E: 无法定位软件包 libsdl2-image-2.0-0:armhf
E: 无法按照 glob ‘libsdl2-image-2.0-0’ 找到任何软件包
E: 无法定位软件包 libsdl2-mixer-2.0-0:armhf
E: 无法按照 glob ‘libsdl2-mixer-2.0-0’ 找到任何软件包
E: 无法定位软件包 libsdl2-ttf-2.0-0:armhf
E: 无法按照 glob ‘libsdl2-ttf-2.0-0’ 找到任何软件包
E: 无法定位软件包 libopenal1:armhf
E: 无法定位软件包 libxcomposite1:armhf
E: 无法定位软件包 libxtst6:armhf
E: 无法定位软件包 libsm6:armhf
E: 无法定位软件包 libice6:armhf
E: 无法定位软件包 libgl1:armhf
E: 无法定位软件包 libxinerama1:armhf
E: 无法定位软件包 libxdamage1:armhf
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成                 
libncurses5:armhf 已经是最新版 (6.3-2ubuntu0.1)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
N: 忽略‘x86.listd’(于目录‘/etc/apt/sources.list.d/’),鉴于它的文件扩展名无效
libgl1-mesa-dri:arm64   23.0~panfork~csf~git221210.120202c6757~j+3
Detected mesa driver for 64 bit ARM. Installing complementary 32 bit one
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成                 
N: 忽略‘x86.listd’(于目录‘/etc/apt/sources.list.d/’),鉴于它的文件扩展名无效
E: 无法定位软件包 libgl1-mesa-dri:armhf
Don't forget to compile/install Box64!
Script complete.
ptitSeb commented 6 months ago

You don't need x86 repo to run steam with box86+box64. You can remove it (that might help for conflict).

Anyway, that doesn't look like conflict, more like package that evolved / change name. Adapt the script to you OS so the package installs. You have the dependancy, but you need to adapt some of the name (use command line autocomplete maybe?).

Also, you are sure you installed armhf architecture already?

nongze commented 5 months ago

I used other systems and successfully built them. After running install_steam.sh, there were no errors reported. But when running "Steam" on the terminal, it prompts the following: /usr/local/bin/steam: line 5: /root/steam/bin/steam: No such file or directory

ptitSeb commented 5 months ago

You are probably missing either binfmt integration or armhf subsystem (or simply forgot to restart binfmt service after the make install of box86). Unless you built box86 on other system and just copied box86 on the rk3588s. In that case, you are probably missing a lots of stuufs (some x86 libs and binfmt integration).

nongze commented 4 months ago

Now I know why I can't install Steam anymore. Because in the installation script,wget https://cdn.cloudflare.steamstatic.com/client/installer/steam.deb using HTTPS. But Armbian is unable to establish an SSL connection,so my solution is to change HTTPS to HTTP. Complete sh script:

#!/bin/bash

# create necessary directories
mkdir -p ~/steam
mkdir -p ~/steam/tmp
cd ~/steam/tmp

# download latest deb and unpack
wget http://cdn.cloudflare.steamstatic.com/client/installer/steam.deb
ar x steam.deb
tar xf data.tar.xz

# remove deb archives, not needed anymore
rm ./*.tar.xz ./steam.deb

# move deb contents to steam folder
mv ./usr/* ../
cd ../ && rm -rf ./tmp/

# create run script
echo "#!/bin/bash
export STEAMOS=1
export STEAM_RUNTIME=1
export DBUS_FATAL_WARNINGS=0
~/steam/bin/steam $@" > steam

# make script executable and move
chmod +x steam
sudo mv steam /usr/local/bin/

# detect if we're running on 64 bit Debian (maybe this can be moved in another script then mentioned in documentation for the people that don't use steam but don't want a headache)
MACHINE_TYPE=`uname -m`
if [ ${MACHINE_TYPE} == 'aarch64' ] && [ -f '/etc/debian_version' ]; then
echo "Detected 64 bit ARM Debian. Installing 32 bit libraries"
sudo dpkg --add-architecture armhf # enable installation of armhf libraries
sudo apt update # update package lists with the newly added arch
# install the libraries that Steam requires
sudo apt install libc6:armhf libsdl2-2.0-0:armhf libsdl2-image-2.0-0:armhf libsdl2-mixer-2.0-0:armhf libsdl2-ttf-2.0-0:armhf libopenal1:armhf libpng16-16:armhf libfontconfig1:armhf libxcomposite1:armhf libbz2-1.0:armhf libxtst6:armhf libsm6:armhf libice6:armhf libgl1:armhf libxinerama1:armhf libxdamage1:armhf
# this one is not there all the time, so just try it...
sudo apt install libncurses5:armhf

# install mesa for armhf if already installed
if dpkg-query -W libgl1-mesa-dri 2>/dev/null; then
echo "Detected mesa driver for 64 bit ARM. Installing complementary 32 bit one"
sudo apt install libgl1-mesa-dri:armhf
fi

echo "Don't forget to compile/install Box64!"
fi

echo "Script complete."
nongze commented 4 months ago

My image comes with some GPU drivers, but the script will uninstall them. What should I do? image If I reinstall them, the prompt "failed to load steamui.so" will appear when starting Steam“