kondrak / vkQuake2

id Software's Quake 2 v3.21 with mission packs and Vulkan support (Windows, Linux, macOS, FreeBSD, Raspberry Pi 4)
GNU General Public License v2.0
896 stars 91 forks source link

Linux - Undefined Symbol Error on New Game #121

Closed d10sfan closed 3 years ago

d10sfan commented 3 years ago

I'm attempting to compile and run vkQuake2 for the luxtorpeda-dev project, which allows for games without Linux versions on Steam to be easily launched, after downloading already built binaries.

This is done with either the steam runtime (based on ubuntu 12.04) or a custom docker image based on Ubuntu 18.04. The luxtorpeda-dev client will then download these binaries and attempt to run them on the system running steam.

I'm running into an issue where after I build the game and attempt to run it on my Manjaro system, it fails with the following error after clicking New Game. I see the intro video and then click the space bar to attempt to skip and get that error.

./quake2: symbol lookup error: /run/media/d10sfan/Ext Storage/SteamLibrary/steamapps/common/Quake 2/vkquake2/./baseq2/gamex64.so: undefined symbol: __atan2_finite

I've attached the full output in the terminal window below:

run.log

This is the script I'm using to build it: https://github.com/luxtorpeda-dev/packages/pull/203/files. Similar scripts were used to build yquake2 and vkquake

Let me know if you need any further information and if there's anything I'm doing that needs to be fixed.

kondrak commented 3 years ago

This looks a somewhat related issue, I have no way to test it at this point but leaving it as a reference: https://www.mail-archive.com/debian-glibc@lists.debian.org/msg59264.html Which version of libc are you building with?

d10sfan commented 3 years ago

For the ubuntu 18.04 based one, I'm using libc version: GNU C Library (Ubuntu GLIBC 2.27-3ubuntu1.4) stable release version 2.27.

kondrak commented 3 years ago

Can you check if the error persists if you remove -ffast-math from linux/Makefile and rebuild the whole thing?

d10sfan commented 3 years ago

That seems to work, thanks! Is there any downside to building with that flag removed?

kondrak commented 3 years ago

Among other things, this flag enables some float operation optimizations at the cost of not being fully compliant with the ISO or C++ standard, so in fact it's considered to be unsafe/dangerous in certain applications. As for optimizations, it's unlikely that on modern systems it will be noticeable in a game like Quake 2. I'll run some tests without the flag and just remove it from the Makefile if all is fine (which it most likely will be).

d10sfan commented 3 years ago

Ok thanks for the help. I'll keep that in my build for now as a patch, and I'll re-base in the future