View previous topic :: View next topic |
Author |
Message |
jauren n00b
Joined: 17 Aug 2005 Posts: 4
|
Posted: Fri Jun 16, 2006 9:29 pm Post subject: Quake2 Undefined Symbol |
|
|
Just emerged quake2-icculus and quake2-data. Everything is set up, and I can play the game w/ a software renderer. However, if I try to switch to either of the "OpenGL GLX" or "SDL OpenGL" video drivers, the load fails w/ an undefined symbol.
------- Loading ref_glx.so -------
LoadLibrary("ref_glx.so") failed: /usr/games/lib/quake2-icculus/ref_glx.so: undefined symbol: OpenJoystick
------- Loading ref_sdlgl.so -------
LoadLibrary("ref_sdlgl.so") failed: /usr/games/lib/quake2-icculus/ref_sdlgl.so: undefined symbol: OpenJoystick
I got the quake2 source from icculus and did a grep in it:
$ grep OpenJoystick * -r
linux/gl_glx.c:qboolean OpenJoystick(cvar_t *joy_dev) {
linux/rw_x11.c:qboolean OpenJoystick(cvar_t *joy_dev) {
linux/rw_sdl.c:qboolean OpenJoystick(cvar_t *joy_dev) {
linux/.#rw_sdl.c.1.22:qboolean OpenJoystick(cvar_t *joy_dev) {
linux/joystick.c:qboolean OpenJoystick(cvar_t *);
linux/joystick.c: if ((joy_avail = OpenJoystick(joy_dev))) {
linux/joystick.h:qboolean OpenJoystick(cvar_t *);
And in linux/joystick.h:
// Provided in platform specific manner
qboolean OpenJoystick(cvar_t *);
qboolean CloseJoystick();
void PlatformJoyCommands(int *, int *);
(The comment indicates that it's up to the platform driver to provide OpenJoystick).
nm didn't work on ref_glx.so or ref_sdlgl.so, but a string search in those binary files did find the text OpenJoystick.
All the joystick stuff in the source code can be turned off with an #ifdef Joystick. A quick look through the build window where quake2 was emerge'd showed a CFLAGS line with -DJoystick in it.
I tried "USE=-joystick emerge quake2-icculus", but no change.
So:
1. Has anyone run across this before, and is there an easy way to fix it, and
2. If not, is there a way to just disable joystick support (perhaps by getting the compile to /not/ #define Joystick) without just getting the source and compiling it myself. |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Sat Jun 17, 2006 12:52 am Post subject: Re: Quake2 Undefined Symbol |
|
|
jauren wrote: | without just getting the source and compiling it myself. |
Well, the ebuild compiles the source, with a few patches. It contains the "joystick" USE flag, which should toggle BUILD_JOYSTICK=YES in the Makefile. I don't see a -DJoystick when compiling it. |
|
Back to top |
|
|
jauren n00b
Joined: 17 Aug 2005 Posts: 4
|
Posted: Sat Jun 17, 2006 1:28 pm Post subject: |
|
|
Right, but if I compile it myself, I am doing so outside the emerge process. I'm looking for a "real" fix. So I guess my question is, is the current ebuild somehow broken (unlikely), and if not, does anyone know what I might have done to break it for my machine? |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Sat Jun 17, 2006 1:39 pm Post subject: |
|
|
jauren wrote: | I'm looking for a "real" fix. |
As opposed to what? Ebuilds don't patch the source code to break things, they patch the source code to fix things. If there's a bug in the ebuild or the source code, then it's best to fix it in the ebuild, so everyone benefits.
Have you got a joystick set up in the kernel? Does grep JOY /usr/src/linux/.config show anything set? Do you have /dev/input/js0? Have you played with the USE flags (especially nojoystick) for the media-libs/libsdl ebuild?
It's weird that you see -DJoystick - perhaps there's a bug in the Makefile. |
|
Back to top |
|
|
jauren n00b
Joined: 17 Aug 2005 Posts: 4
|
Posted: Sat Jun 17, 2006 2:12 pm Post subject: |
|
|
> As opposed to what?
As opposed to me manually fixing the problem by compiling myself rather than through the ebuild.
I've got JOYSTICK_GRIP compiled as a module, but not inserted, so there's no /dev/input/js0. I have not played with the SDL USE flags, but I have other SDL games running on this rig with no problem. The nature of the problem (an unresolved external in a lib compiled as part of quake2) leads me to believe that this is a compilation problem with quake2. It might not be a problem with the ebuild itself, but perhaps has to do with the particular set of USE flags I have set on my system.... ? (Clarification: I'm not trying to get a joystick to work with quake2 -- I won't be using one even if it did -- I'm trying to get video acceleration working, and this joystick thing has blindsided me).
Anyway, I played some more with it this morning. I tried the opposite approach:
USE=joystick emerge quake2-icculus
(Note: no dash in front of joystick).
Now, the "OpenGL GLX" driver loads and works. The SDL GL driver fails w/ a new undefined symbol: UpdateHardwareGamma.
So, it's good enough for me at this point...I really don't have time to be playing games anyhow . Somehow, partial joystick support got compiled in even without joystick defined (it's not in my global USE Flags). I am absolutely /certain/ that -Djoystick was in the CFLAGS during at least part of the quake2 build before I set USE=joystick.
Again, it works for me now, but if there's any command I can run that will give a maintainer more info or something, I'll be happy to do so. |
|
Back to top |
|
|
UdoB n00b
Joined: 14 May 2006 Posts: 2
|
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Sat Jun 17, 2006 9:56 pm Post subject: |
|
|
I ran: Code: | emerge quake2-icculus | grep oystick | (intentially without the J), and a snippet is:
Code: | -o releasei386/ref_gl/joystick.o -c src/linux/joystick.c |
I'm gonna speculate that this interfaces with the joystick code in the kernel somehow. Are you running an exotic kernel?
http://qudos.quakedev.com looks interesting - I'll look into creating some ebuilds for the engines there. |
|
Back to top |
|
|
|