Bug 101260 - [Qt] QtWebKit-2.3 tries to link against Xrender on OpenGLES2 platform
Summary: [Qt] QtWebKit-2.3 tries to link against Xrender on OpenGLES2 platform
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P3 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: QtWebkit23
  Show dependency treegraph
 
Reported: 2012-11-05 14:44 PST by Cedric Hombourger
Modified: 2012-11-07 06:24 PST (History)
2 users (show)

See Also:


Attachments
proposed patch (1.82 KB, patch)
2012-11-06 13:50 PST, Cedric Hombourger
no flags Details | Formatted Diff | Diff
patch for trunk (1.78 KB, patch)
2012-11-07 04:31 PST, Cedric Hombourger
no flags Details | Formatted Diff | Diff
Patch for qtwebkit23 (1.98 KB, patch)
2012-11-07 05:39 PST, Allan Sandfeld Jensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Hombourger 2012-11-05 14:44:40 PST
While Building QtWebkit-2.3 (git commit abd77b3f85375632aa313934e8eb9ae89f2bbf2e, from git://gitorious.org/+qtwebkit-developers/webkit/qtwebkit-23.git) for an embedded system running Qt 4.8.1 with OpenGL ES2, the build eventually dies with a failure to find -lXrender.

Linking against Xrender was introduced with the below change:

commit 611b1450798b71d2931d1d90a585e2cae77ac4c2
Author: commit-queue <commit-queue@webkit.org>
Date:   Wed Sep 12 12:10:20 2012 +0000

    [Qt] Build on X11 with GraphicsSurface but without NPAPI is broken
    https://bugs.webkit.org/show_bug.cgi?id=96495
    
    Patch by Simon Hausmann <simon.hausmann@nokia.com> on 2012-09-12
    Reviewed by Kenneth Rohde Christiansen.
    
    When enabling NPAPI we link against XRender on X11. The other component that needs Xrender
    is GraphicsSurface. So when building without NPAPI we need to make sure that we link in Xrender.
    
    This patch cleans up the GraphicsSurface related linkage required on Mac OS X and X11 by wrapping
    it in use?(graphics_surface) instead of 3D_GRAPHICS. It is not neccesary to perform the have?(XCOMPOSITE)
    check anymore because it's already done in features.prf before enabling use_graphics_surface in the
    first place.
    
    * WebCore.pri:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128294 268f45cc-cd09-0410-ab3c-d52691b4dbfc

In WebCore.pri, one can indeed read:

contains(DEFINES, WTF_USE_3D_GRAPHICS=1) {
    contains(QT_CONFIG, opengles2):!win32: LIBS += -lEGL
    mac: LIBS += -framework IOSurface -framework CoreFoundation
    linux-*: {
        contains(DEFINES, HAVE_XCOMPOSITE=1): LIBS += -lXcomposite
        LIBS += -lXrender
        CONFIG *= x11
    }
    haveQt(4): QT *= opengl
}
Comment 1 Cedric Hombourger 2012-11-05 14:45:41 PST
I wonder if something like:

contains(DEFINES, WTF_USE_3D_GRAPHICS=1) {
    contains(QT_CONFIG, opengles2):!win32: LIBS += -lEGL
    mac: LIBS += -framework IOSurface -framework CoreFoundation
    linux-*: {
        xlibAvailable() {
            contains(DEFINES, HAVE_XCOMPOSITE=1): LIBS += -lXcomposite
            LIBS += -lXrender
            CONFIG *= x11
        }
    }
    haveQt(4): QT *= opengl
}

would do the trick
Comment 2 Jocelyn Turcotte 2012-11-06 03:45:13 PST
(In reply to comment #1)
Looks like we have similar logic in Tools/qmake/mkspecs/features/features.prf where we have:
config_libXcomposite: WEBKIT_CONFIG += have_xcomposite
config_libXrender: WEBKIT_CONFIG += have_xrender
config_glx:!contains(QT_CONFIG, opengles2): WEBKIT_CONFIG += have_glx

Could you try something like this and tell me if that works?

contains(DEFINES, HAVE_XCOMPOSITE=1): LIBS += -lXcomposite
contains(DEFINES, HAVE_XRENDER=1): LIBS += -lXrender
contains(DEFINES, HAVE_GLX=1): CONFIG *= x11
Comment 3 Cedric Hombourger 2012-11-06 06:33:12 PST
Thanks Jocelyn, that worked too!
I'll attach a patch with your changes to this ticket
Comment 4 Cedric Hombourger 2012-11-06 13:50:39 PST
Created attachment 172643 [details]
proposed patch
Comment 5 Jocelyn Turcotte 2012-11-07 02:31:52 PST
(In reply to comment #4)
> Created an attachment (id=172643) [details]
> proposed patch

The patch doesn't apply since it was created from the 2.3 branch and this code was moved to Tools/qmake/mkspecs/features/features.prf in trunk.

If you can redo the patch on top of trunk it would be better, or tell if you want me to do it instead.
Comment 6 Cedric Hombourger 2012-11-07 02:37:21 PST
I don't mind providing a patch for trunk but one question, how do I get this patch also reviewed and applied for the 2.3 branch?
Comment 7 Jocelyn Turcotte 2012-11-07 03:55:18 PST
(In reply to comment #6)
> I don't mind providing a patch for trunk but one question, how do I get this patch also reviewed and applied for the 2.3 branch?

Allan goes over trunk and cherry-picks most of the patches so it should end up in the branch after 2-3 weeks.
Adding this to the 2.3 tracker bug just in case.
Comment 8 Cedric Hombourger 2012-11-07 04:31:32 PST
Created attachment 172757 [details]
patch for trunk
Comment 9 Early Warning System Bot 2012-11-07 04:41:35 PST
Comment on attachment 172757 [details]
patch for trunk

Attachment 172757 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/14765060
Comment 10 Early Warning System Bot 2012-11-07 04:43:35 PST
Comment on attachment 172757 [details]
patch for trunk

Attachment 172757 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/14765062
Comment 11 Jocelyn Turcotte 2012-11-07 04:55:29 PST
Comment on attachment 172757 [details]
patch for trunk

Humm that would be wrong since GRAPHICS_SURFACE is presently bound to X on Linux so it wouldn't make sense to make it conditional.

The conditions were moved and I think that the issue is fixed on trunk because of this part in Tools/qmake/mkspecs/features/features.prf:
use?(3d_graphics) {
    mac: WEBKIT_CONFIG += use_graphics_surface
    win32:contains(QT_CONFIG, opengles2): WEBKIT_CONFIG += use_graphics_surface
    linux-*:contains(WEBKIT_CONFIG, have_glx):contains(WEBKIT_CONFIG, have_xcomposite):contains(WEBKIT_CONFIG, have_xrender): WEBKIT_CONFIG += use_graphics_surface
}

Sorry that I asked you to create another patch without checking first, but hopefully the issue will be fixed for you on the next merge from trunk. Please tell if you have other issues.
Comment 12 Cedric Hombourger 2012-11-07 04:58:04 PST
No issues. I am closing this issue then. Thanks for your support!
Comment 13 Allan Sandfeld Jensen 2012-11-07 05:32:22 PST
Reopen. The code has been merged, but the merge is slightly wrong because the build systems has diverged.
Comment 14 Allan Sandfeld Jensen 2012-11-07 05:39:37 PST
Created attachment 172771 [details]
Patch for qtwebkit23

This merges the code to be closer to trunk but using the old build-system. Note that use_graphics_surface will never be set since the HAVE_X.* flags only work in qt5.
Comment 15 Allan Sandfeld Jensen 2012-11-07 06:24:14 PST
commited as 1edb2e102012ecd6ed7ea062b99678cd4b1a974f
and pushed in qtwebkit-2.3-staging.