[GRASS-dev] [grass-code I][536] libGL linking problem on OSX 10.5 (Leopard)

grass-dev at grass.itc.it grass-dev at grass.itc.it
Thu Nov 22 11:40:38 EST 2007


code I item #536, was opened at 2007-11-22 10:40
Status: Open
Priority: 3
Submitted By: William Kyngesburye (kyngchaos)
Assigned to: Nobody (None)
Summary: libGL linking problem on OSX 10.5 (Leopard) 
Issue type: other bug
Issue status: None
GRASS version: CVS HEAD
GRASS component: build
Operating system: MacOS X
Operating system version: 10.5
GRASS CVS checkout date, if applies (YYMMDD): 


Initial Comment:
Apple messed up their linker a bit in OSX 10.5 Leopard (Xcode 3).

Some libraries cause the linker to spit an error:

ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib

It's not the libraries that are broken - I got that also with the Tiger build of one of my frameworks, and it happens with Apple's 10.4 SDK in Leopard.  The common workaround is to link those libraries with the -dylib_file flag, which remaps a library from it's installed path to another path.  But oddly, for this workaround, you remap the library to the same location:

-dylib_file /usr/X11/lib/libGL.dylib:/usr/X11/lib/libGL.dylib

So, that's the background info.  This affects the ogsf library and NVIZ.

What is needed is some extra configure logic in the opengl/X11 section to use different OPENGLLIB flags for Darwin-9 $system versions.  The GLU library does not have this problem. Xcode 2.5 and earlier on OSX 10.4 (Darwin-8) does not have this problem.

There were also some undefined symbols with this, so the full OPENGLLIB needs to be:

-dylib_file /usr/X11/lib/libGL.dylib:/usr/X11/lib/libGL.dylib -undefined dynamic_lookup

This works at runtime since the X11 libGL is linked to the system libGL, and linking the system libGL at compile time does NOT work (probably related to the dylib cycle reexport weirdness).

This will be needed until (and if) Apple fixes the problem, so hopefully it will be a temporary workaround.  The only other workaround that I could figure out is to patch platform.make.in to have those flags explicitly, instead of configured.

----------------------------------------------------------------------

You can respond by visiting: 
http://wald.intevation.org/tracker/?func=detail&atid=204&aid=536&group_id=21


More information about the grass-dev mailing list