Re: X11 OpenGL and Wine
Re: X11 OpenGL and Wine
- Subject: Re: X11 OpenGL and Wine
- From: "Ryan Walklin" <email@hidden>
- Date: Tue, 13 Nov 2007 14:10:57 +1300
On Nov 12, 2007 10:27 PM, Ben Byer <email@hidden> wrote:
>
> On Nov 11, 2007, at 5:47 AM, email@hidden wrote:
>
> >
> > Also, for me at
> > least, without symlinking /S/L/Frameworks/OpenGL.framework/Headers to
> > /usr/X11/lib/GL, it doesn't find GL/gl.h, GL/glx.h, GL/glext.h, and
> > GL/glu.h when doing ./configure.
>
> Hm. I just downloaded and built wine straight out of git. Not that
> it worked, but it built. :)
>
Me too on a stock Leopard install.
> Check config.log to figure out exactly what's going on.
>
> With no environment variables set:
> $ ./configure
> [...]
> checking for -lX11... libX11.6.dylib
> checking for -lXext... libXext.6.dylib
> checking for X11/Xlib.h... yes
> checking for X11/XKBlib.h... yes
> checking for X11/Xutil.h... yes
> checking for X11/Xcursor/Xcursor.h... yes
> [...]
> checking for -lGL... not found
> checking for gluLookAt in -lGLU... yes
> [...]
>
> Odd. Let's look at config.log. The "not found" is because of this:
> [...]
> ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib
> collect2: ld returned 1 exit status
>
> Because that program failed to link, it thinks the library is
> unusable. So, adding the LDFLAGS makes it "see" that file.
>
I'd worked this out after an afternoon of playing with the script and
some test cases, although it turns out the easiest test case is "gcc
-lGL" to cause the cyclic dependency error :P
> Ryan wrote:
> > I've been using that DYLD_FALLBACK_LIBRARY_PATH since I saw it used by
> > the chap maintaining the Macports Wine port. It also seemed to be
> > supported by the section of the page at [...] from which I
> > concluded /usr/X11/lib wasn't part of the standard linkersearch path.
>
> I was a bit too harsh, there. Yes, it's fully supported, but usually
> people use it to accomplish dirty hacks.
>
> <rant>For example, it's the reason that Gimp.app 2.2 doesn't work on
> Leopard -- they bundle a copy of all of their dylibs inside the app
> bundle, which is super convenient. The problem is that they then have
> to use the DYLD_xxx variables to point the linker inside the app
> bundle, which then means that those libraries override newer versions
> shipped with Leopard. This makes some of the newer libraries in
> Leopard that weren't overridden freak out, because those newer
> libraries depend on other newer libraries which DO get overridden by
> the Gimp.app libraries. It's very confusing for everyone.</rant>
>
> (In this case, though, it may be the correct way to handle this.)
Heh heh, yeah I figured this was the case, and completely understand
the potential for breakage. I couldn't work out another way to get it
to use the X11 libs though.
>
> Back to Zach's message:
>
> > And even after that, when running a program, with or without LDFLAGS
> > and
> > DYLD_FALLBACK, it doesn't find functions needed -
> > X11DRV_wglGetProcAddress
> > and X11DRV_ChoosePixelFormat. Neither showed up when i did nm
> > /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/
> > libGL.dylib
> > so is it just a matter of the functions not being implemented?
>
> Refer back to my earlier message about OpenGL.framework/libGL.dylib
> vs. /usr/X11/lib/libGL.dylib. Take, for instance, glGetProcAddress.
> Refer to this code:
> http://source.winehq.org/git/wine.git/?a=blob;f=dlls/winex11.drv/opengl.c;h=c510a3b17b5d42fadb5fc0905696f0f9fe4e331a;hb=HEAD#l370
>
> It's trying to dlopen "libGL.dylib" -- which it only finds with the
> DYLD_FALLBACK_LIBRARY_PATH. Once it opens /usr/X11/lib/libGL.dylib,
> dyld then opens the OpenGL.framework dylib as a dependency, and what I
> think is happening is that when it goes to get the address of GL
> symbols, it's getting them from the OpenGL.framework instead of the
> X11 libGL.dylib.
>
> If you can follow all of that, you can have my job. I'm punting this
> to the linker folks :/
>
Heh, vaguely, I don't envy you. Thank you very much for your detailed
explanations and patient help, its very much appreciated. Can I take
your final statement to mean that you've formally approached whoever
is in charge of the linker regarding this? I understand that its not
your responsibility and certainly not a high priority (I just want to
play Half-life without rebooting!), but it would be nice to get this
fixed.
As a final footnote, I was able to get OpenGL working with Wine under
the 9A466 developer seed, but it has then been broken up until now. I
don't think the root cause of the problem in the end will be wine or
X11, as I had the same issue with Tiger (using the DYLD_FALLBACK trick
to find the X libs causing X RENDER errors), rather just some
difference between the way the Linux and OS X linkers work. Anyway,
it's been educational!
Thanks again and Kind Regards,
Ryan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden