Bug 8529

Summary: Gtk+3 applications still fail to start without libGL.s0.1
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Jussi Kukkonen <jku>
Component: graphicsAssignee: Jussi Kukkonen <jku>
Status: VERIFIED FIXED QA Contact: Bogdan Alexandru Voiculescu <bogdanx.a.voiculescu>
Severity: normal    
Priority: Medium+ CC: bogdanx.a.voiculescu, meta.mr.watcher, meta.watcher
Version: unspecified   
Target Milestone: 2.0   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Jussi Kukkonen 2015-10-16 12:25:24 UTC
Gdk initialization calls epoxy GLX api, which promptly exit()s if libGL.so.1 is not present. This is a serious problem since it affects all GTK+3 applications, even if they do not use OpenGL.


Workaround is to set "GDK_GL=disabled" environment variable. Proper fix would include either 
  A) epoxy failing gracefully
  B) epoxy or GTK having an additional function that checks for existence of specific GL (in this case GLX, libGL.so.1).

Looks like the fix for 2.0 timeframe will include at least a #ifdef in the Gdk init code (so a dependency on opengl distro feature).
Comment 1 Jussi Kukkonen 2015-10-27 13:22:55 UTC
commit 48443ccd93d0406ebfe627b98ac9283f6767c1dd
Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
Date:   Wed Oct 21 16:25:31 2015 +0300

    gtk+3: Do not try to initialize GL without libgl
    
    Gdk initialization ends up calling epoxy GLX api, which calls exit()
    if libGL.so.1 is not present. In practice this prevents all GTK+
    applications from starting if GLX is not present.
    
    If opengl and x11 distro features are set, make gtk+3 RDEPEND on libgl.
    If opengl and x11 distro features are not set, use #ifdef to prevent
    the GL initialization.
    
    Remove libgl dependency from gtk3-demo: it can now run without
    libgl (although trying to run the glarea demo will exit in that case).
    
    [YOCTO #8529]
    
    (From OE-Core rev: f9540f50ea661e260ec2b82436238cfb989e23c5)
    
    Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
    Signed-off-by: Ross Burton <ross.burton@intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Comment 2 Bogdan Alexandru Voiculescu 2015-11-17 12:59:54 UTC
Verified on master: fc45deac89ef63ca1c44e763c38ced7dfd72cbe1
Using 
    DISTRO_FEATURES_append = " wayland"
    DISTRO_FEATURES_remove = "x11"
    IMAGE_INSTALL_append = " gtk+3-demo mesa-megadriver"
a QEMUx86 image and this patch for passing over bug https://bugzilla.yoctoproject.org/show_bug.cgi?id=8551
http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/master&id=24cd75fac25b96208b22babe19a0e27314ccbe15
Comment 3 Jussi Kukkonen 2015-11-17 13:11:17 UTC
(In reply to comment #2)
> Verified on master: fc45deac89ef63ca1c44e763c38ced7dfd72cbe1

Thanks a bunch: that was a bit tricky to verify, I'll try to provide better instructions in future.