On 23 févr. 2011, at 15:19, David Allsopp wrote:

It certainly is an invaluable platform debugging aid! ocamlmklib also supports it - perhaps using it with the command which generates the library may help further?

Duh, I should have thought of this!

The problem does not seem to come from gl_stubs:

[:)][top] % ocamlmklib -verbose  -oc  gl_stubs  gl.wrap.o  -framework OpenGL
+ gcc -bundle -flat_namespace -undefined suppress -read_only_relocs suppress -o ./dllgl_stubs.so gl.wrap.o -L/Users/schmitta/godi/lib -framework OpenGL   
ld: warning: -read_only_relocs cannot be used with x86_64
+ ar rc ./libgl_stubs.a  gl.wrap.o; ranlib ./libgl_stubs.a

but from GL.cmxa:
[:)][top] % ocamlmklib -verbose  -o  GL  GL.cmx  -framework OpenGL -lgl_stubs
+ /Users/schmitta/godi/bin/ocamlopt -a -o GL.cmxa  GL.cmx -cclib -lGL -ccopt -L/Users/schmitta/godi/lib -ccopt -framework -ccopt OpenGL  -cclib -lgl_stubs 

I don't understand why ocamlmklib adds the "-lGL" here. (It does the same thing with the Glut archive.)

Is this a bug?

Could this be related to this warning:
ld: warning: -read_only_relocs cannot be used with x86_64 ?

http://caml.inria.fr/mantis/view.php?id=4863 (see the notes, not the bug report)

Ah, I haven't updated to 3.12 yet. Doing so ...

So the warning have gone away, but the previous behavior still remains: ocamlmklib inserts an extra "-lGL" when creating the library.

Alan