ptitSeb / box64

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

[TF2] Missing symbols in libstdc++.so.6 #1460

Closed System64fumo closed 1 month ago

System64fumo commented 5 months ago

Team fortress 2 (64-Bit) fails to launch, Log:

Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL SHA1 SHA2 PageSize:4096 Running on Kryo-3XX-Silver Kryo-3XX-Gold with 8 Cores
Params database has 38 entries
Box64 with Dynarec v0.2.6  built on Mar 26 2024 18:47:02
BOX64: Detected 48bits at least of address space
Counted 26 Env var
BOX64 LIB PATH: /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/:/lib/:./: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/bin/:/usr/bin/site_perl/:/usr/bin/vendor_perl/:/usr/bin/core_perl/
Looking for ./tf_linux64
Rename process to "tf_linux64"
Using emulated /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libmimalloc.so
Redirecting overridden malloc from symtab function for /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libmimalloc.so
Using native(wrapped) libdl.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libutil.so.1
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Using emulated bin/linux64/launcher.so
Using emulated /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libtier0.so
Using emulated /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libvstdlib.so
Using emulated /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libsteam_api.so
Redirecting overridden malloc from symtab function for /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libsteam_api.so
Using emulated /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libtogl.so
Using native(wrapped) libSDL2-2.0.so.0
Using native(wrapped) libm.so.6
Using emulated /lib/x86_64-linux-gnu/libstdc++.so.6
Using emulated /lib/x86_64-linux-gnu/libgcc_s.so.1
Warning: Global Symbol _ZN9__gnu_cxx21zoneinfo_dir_overrideEv not found, cannot apply R_X86_64_GLOB_DAT @0x7fff0624e268 ((nil)) in /lib/x86_64-linux-gnu/libstdc++.so.6
Warning: Weak Symbol _ITM_memcpyRtWn not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff0624f060 (0x9c0f6)
Warning: Weak Symbol _ITM_RU1 not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff0624f6a0 (0x9cd76)
Warning: Weak Symbol _ZGTtdlPv not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff0624fb00 (0x9d636)
Warning: Weak Symbol _ITM_RU8 not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff0624fff8 (0x9e026)
Warning: Weak Symbol _ITM_memcpyRnWt not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff062504a8 (0x9e986)
Warning: Weak Symbol _ZGTtnam not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff06250c88 (0x9f946)
Error loading needed lib libmvec.so.1
Error loading one of needed lib
Error initializing needed lib libtogl.so
Error loading one of needed lib
Error initializing needed lib bin/linux64/launcher.so
Failed to load the launcher

Note: I launched TF2 outside of steam for debugging porpoises, It will fail to launch with/out steam.

NumanTF2 commented 3 months ago

try these commands

sudo dpkg --add-architecture amd64 && apt update
sudo apt install libc6:amd64
sudo apt install gcc-12-base:amd64
sudo apt install libstdc++6:amd64
sudo apt install libgcc-s1:amd64

then run tf2 again.

System64fumo commented 3 months ago

I use artix actually And i do have those installed

ptitSeb commented 3 months ago

I think it doesn't find libmvec.so.1, that seems to be the fisrt missing libs (ignore the Warning on the missing symbols, those are just warning, not fatal errors).

System64fumo commented 3 months ago

I do have that file though? (/usr/lib/libmvec.so.1)

ptitSeb commented 3 months ago

I do have that file though? (/usr/lib/libmvec.so.1)

Yes, but that's probably an aarch64 version of it. Unfortnatly, this lib is not wrapped currently by box64, so you have to bring an x86_64 version of it for box64 to use it.

System64fumo commented 3 months ago

Ah, got it, i will try this later and report back on it, Are there any plans on wrapping it with box64 in the future?

ptitSeb commented 3 months ago

Ah, got it, i will try this later and report back on it, Are there any plans on wrapping it with box64 in the future?

I wasn't, but I'll check later if it's east to wrap or not...

System64fumo commented 3 months ago

Okay i finally got around to testing it and i'm afraid it still doesn't work even with the included lib:

Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL SHA1 SHA2 PageSize:4096 Running on Kryo-3XX-Silver Kryo-3XX-Gold with 8 Cores
Params database has 38 entries
Box64 with Dynarec v0.2.6  built on Apr  2 2024 12:17:33
BOX64: Detected 48bits at least of address space
Counted 31 Env var
BOX64 LIB PATH: /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/:/mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/
BOX64 BIN PATH: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/bin/:/usr/lib/jvm/default/bin/:/usr/bin/site_perl/:/usr/bin/vendor_perl/:/usr/bin/core_perl/
Looking for /mnt/data/Steam/steamapps/common/Team Fortress 2/tf_linux64
Rename process to "tf_linux64"
Using emulated /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libmimalloc.so
Redirecting overridden malloc from symtab function for /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libmimalloc.so
Using native(wrapped) libdl.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libutil.so.1
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Using emulated bin/linux64/launcher.so
Using emulated /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libtier0.so
Using emulated /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libvstdlib.so
Using emulated /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libsteam_api.so
Redirecting overridden malloc from symtab function for /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libsteam_api.so
Using emulated /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libtogl.so
Using native(wrapped) libSDL2-2.0.so.0
Using native(wrapped) libm.so.6
Using emulated /lib/x86_64-linux-gnu/libstdc++.so.6
Using emulated /lib/x86_64-linux-gnu/libgcc_s.so.1
Warning: Global Symbol _ZN9__gnu_cxx21zoneinfo_dir_overrideEv not found, cannot apply R_X86_64_GLOB_DAT @0x7fff0624e268 ((nil)) in /lib/x86_64-linux-gnu/libstdc++.so.6
Warning: Weak Symbol _ITM_memcpyRtWn not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff0624f060 (0x9c0f6)
Warning: Weak Symbol _ITM_RU1 not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff0624f6a0 (0x9cd76)
Warning: Weak Symbol _ZGTtdlPv not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff0624fb00 (0x9d636)
Warning: Weak Symbol _ITM_RU8 not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff0624fff8 (0x9e026)
Warning: Weak Symbol _ITM_memcpyRnWt not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff062504a8 (0x9e986)
Warning: Weak Symbol _ZGTtnam not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff06250c88 (0x9f946)
Using emulated /lib/x86_64-linux-gnu/libmvec.so.1
Error: Symbol _ZGVbN4vv_powf not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff050ad048 (0x19096) in /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libtogl.so
Error: Symbol _ZGVbN2v_sin not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff050ad0b0 (0x19166) in /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libtogl.so
Error: Symbol _ZGVbN2vv_pow not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff050ad2a0 (0x19546) in /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libtogl.so
Error: relocating Plt symbols in elf libtogl.so
Error initializing needed lib libtogl.so
Error loading one of needed lib
Error initializing needed lib bin/linux64/launcher.so
Failed to load the launcher

Could you try taking a look at this? Also the way i launch tf2 (for debugging purposes) is like so:

cd /path/to/Team\ Fortress\ 2
export BOX64_LD_LIBRARY_PATH=/path/to/Team\ Fortress\ 2/bin/linux64
export VERSION_CODENAME=sniper
./tf.sh
ptitSeb commented 3 months ago

Not sure where you found this libstdc++, but it's not good, there are 3 symbols missings:

Error: Symbol _ZGVbN4vv_powf not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff050ad048 (0x19096) in /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libtogl.so
Error: Symbol _ZGVbN2v_sin not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff050ad0b0 (0x19166) in /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libtogl.so
Error: Symbol _ZGVbN2vv_pow not found, cannot apply R_X86_64_JUMP_SLOT @0x7fff050ad2a0 (0x19546) in /mnt/data/Steam/steamapps/common/Team Fortress 2/bin/linux64/libtogl.so

that are from libstdc++, I'm pretty sure...

System64fumo commented 3 months ago

If they're native then from stock artix repos, I haven't added any external libs besides what you've suggested to add (libmvec.so.1)

System64fumo commented 1 month ago

Randomly decided to test tf2 again today and it seems to work just fine now with the exception of being unable to launch it from steam directly (Needs to be launched externally by going to the Team Fortress 2 folder, running export VERSION_CODENAME=sniper, then tf.sh)