JACoders / OpenJK

Community effort to maintain and improve Jedi Academy (SP & MP) + Jedi Outcast (SP only) released by Raven Software
GNU General Public License v2.0
2.01k stars 612 forks source link

Undefined symbol _SetParent running on x86-64 Linux #673

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hello

Not entirely sure if this is an issue on my side, but whenever I try to start a game from the menu in JA I get the error VM_CreateLegacy: jampgamex86_64.so failed!. The console lists the error undefined symbol: _SetParent for the jampgamex86_64.so file.

It should be noted that I'm building the Git version using the recently released GCC 5.1, which should probably not make any difference but since it's very recent, I thought it would be worth mentioning ;).

If this is an issue on my side, feel free to let me know and close this issue.

PS: On the subject of building and linking, is it normal that JO does not have any font rendering, is there perhaps a missing font rendering library of sorts (although I'd expect some kind of cmake or linker error in that case)?

Thanks in advance

ensiform commented 9 years ago

Chances are you aren't using the JO version on the font issue.

ghost commented 9 years ago

It seems you were correct on the font issue, the build instructions I used to build JK2 support turned out to be outdated and I was wrongly using the JO assets with the JKA version. Thanks for the tip!

ensiform commented 9 years ago

I didn't think there was any instructions for jk2 specifically since it was WIP and broken all together at one point.

ghost commented 9 years ago

Sorry, I forgot to mention these weren't any official instructions, they were more of a comment on the AUR from the Arch Linux site, I checked the cmake file afterwards and they turned out te be outdated :P.

Gigadoc2 commented 9 years ago

I can reproduce this Error, GCC version 5.1.0 as well. However, your latest nightly http://builds.openjk.org./openjk-2015-05-25-0e30710f-linux-64.tar.gz seems to work fine.

xycaleth commented 9 years ago

I've been trying to install GCC 5.1 in Ubuntu without any luck so far :( Hopefully I can have a look at this soon.

ensiform commented 9 years ago

Is this issue still happening? SetParent sounds like a WinAPI function somewhere.

ghost commented 9 years ago

I've just built the latest snapshot again with GCC 5.1 and am still experiencing this issue (e.g. when trying to create a new multiplayer game). The following is logged in the console:

Sys_LoadLegacyGameDll(./base/jampgamex86_64.so) failed: "Failed loading ./base/jampgamex86_64.so: ./base/jampgamex86_64.so: undefined symbol: _SetParent"

I have a hunch that it has something to do with this line [1]. If I remove the QINLINE, I suddenly get the error:

Sys_LoadLegacyGameDll(./base/jampgamex86_64.so) failed: "Failed loading ./base/jampgamex86_64.so: ./base/jampgamex86_64.so: undefined symbol: Inhabited"

Which is a function just a couple of lines further, so I went a little overboard and defined QINLINE as absolutely nothing and now I can start a game just fine. Perhaps something changed relating to inlining behavior in GCC 5?

[1] https://github.com/JACoders/OpenJK/blob/0e30710fa7208e2cfe012ccbec3f691c54b02a27/codemp/game/g_vehicles.c#L2450

xycaleth commented 9 years ago

@hotoiledgoblinsack Thanks for investigating this. I think you're on to something with QINLINE being the problem. Can you remove the QINLINE keyword from the function you've linked to, and the three functions below it and see if that fixes the problem? (Also make sure to revert QINLINE so that it does something!) Thanks!

If you look at where those functions are used, it doesn't make sense (at least it doesn't to me) to even make them inline. They're used by function pointers so they would never get inlined anyway.

ghost commented 9 years ago

@xycaleth I built from a clean Git repo and removed the four QINLINE modifiers as requested and I seem to be able to start a game now. Seems like it's indeed just those ones generating problems.

ensiform commented 9 years ago

From what @xycaleth said in IRC yesterday, its some conflict between using inline functions for function pointers