After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 657225 - Missing dep on libGL
Missing dep on libGL
Status: RESOLVED FIXED
Product: clutter-gst
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: clutter-gst-maint
clutter-gst-maint
Depends on: 657347
Blocks:
 
 
Reported: 2011-08-24 10:18 UTC by Xavier Claessens
Modified: 2011-09-27 14:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Xavier Claessens 2011-08-24 10:18:20 UTC
When building empathy I get this error: /usr/lib/libclutter-gst-1.0.so.0: undefined reference to `glGetIntegerv'

Seems clutter-gst is using libgl directly but not pulling that dep.
Comment 1 Damien Lespiau 2011-08-25 13:09:48 UTC
Hey,

Okay, so indeed, clutter-gst does not depend explicitly on GL and has been relying on clutter to provide this for a very long time. I'm interested to know why it breaks now, could you cat your clutter-1.0.pc (which version of Clutter are you using?) (it should have a dependency on gl of some kind).

I'm a bit reluctant to duplicate the code to detect the libGL from Clutter's configure.ac but I guess there might not be an other solution.

In the mean time, we are looking at exposing what clutter-gst needs from GL in Clutter/Cogl so we can just get rid of the direct dependency.
Comment 2 Emmanuele Bassi (:ebassi) 2011-08-25 13:20:08 UTC
what's changed is that Cogl stopped depending on GL in the pkg-config when it started dlopening libGL.

these are the requirements of Cogl 1.7.7 on my system:

requires= cairo >= 1.10 gdk-pixbuf-2.0 >= 2.0 libdrm x11 xext xfixes >= 3 xdamage xcomposite >= 0.4 glib-2.0

this is obviously correct, given that Cogl can use libGL or libGLES at runtime.

clutter-gst should have started depending on libGL as soon as it started using the API directly. :-)
Comment 3 Damien Lespiau 2011-08-25 15:24:13 UTC
I understand that cogl does not expose it, but clutter-glx-1.0.pc is still having "gl" in the list of deps, at least here. I thought that was not going to change.

But sure, clutter-gst should have linked against it, just wanted to understand what changed.
Comment 4 Damien Lespiau 2011-08-30 15:56:46 UTC
Ok, to mitigate the breaking, I've committed a tiny patch that should solve this case. It's not ideal, but that workaround should hold until we can rid of the direct call (and as I don't want to bump clutter-gst dep on cogl/clutter) just for
that, it's likely to stay there for the case when link against clutter >= 1.4 but < 1.8.

I'm leaving this bug open until the work to conditionally use cogl_renderer_get_n_fragment_texture_units() is done.

commit c50263f81c233fbbf93f464848384de98787ae66
Author: Damien Lespiau <damien.lespiau@intel.com>
Date:   Tue Aug 30 16:48:31 2011 +0100

    build: Link against -lGL when we know it's safe to
    
    We are using a gl call (glGetIntergerv). However, detecting wich GL
    headers and library to use is getting impossible (as nowedays, cogl even
    has a runtime selection of which library should be dlopened, so it could
    be either one of flavours of the GLES1 DSO or the GLES2 DSO, or the Big
    GL one).
    
    So, really, we should not have any direct GL call in clutter-gst. The
    solution is coming, but in the mean time, just link against -lGL when
    it's safe to assume so.
Comment 5 Damien Lespiau 2011-09-27 14:19:10 UTC
Fixed it properly and now, when compiling with Cogl 1.8.0, clutter-gst does not use direct GL calls anymore. Will be in 1.4.0

commit c369b5bb7bfb557ce92bacc34810b8afe320cc60
Author: Damien Lespiau <damien.lespiau@intel.com>
Date:   Tue Sep 27 14:42:41 2011 +0100

    refactoring: Do not depend on any GL symbol
    
    Since Cogl 1.8.0 we can use cogl_renderer_get_n_fragment_texture_units()
    to know the number of texture image units available for fragment
    shaders and we can thus avoid using the direct GL call glGetIntegerv and
    linking against libGL.
    
    This does not work on OS X though as we can't get the CoglContext out of
    the ClutterBackend in that case. Make sure to special case this.
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=657225