Bug 141796 - [GTK] Fails to compile with cmake 3.2.x
Summary: [GTK] Fails to compile with cmake 3.2.x
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-19 04:50 PST by Tomas Popela
Modified: 2015-02-23 08:06 PST (History)
4 users (show)

See Also:


Attachments
Patch (1.39 KB, patch)
2015-02-19 05:11 PST, Tomas Popela
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Popela 2015-02-19 04:50:38 PST
When compiling 2.7.90 with cmake 3.2.x it fails as the linker flags for X11 are not added:

(truncated) -lpthread -lGL -latk-1.0 -lcairo -lenchant -lfontconfig -lfreetype -lgmodule-2.0 -lharfbuzz -lharfbuzz-icu -licuuc -lgio-2.0 -lgobject-2.0 -lglib-2.0 -ljpeg -lsecret-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lsoup-2.4 -lxml2 -lxslt -lpng -lsqlite3 -lwebp -lz -lgstapp-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgstpbutils-1.0 -lgsttag-1.0 -lgstvideo-1.0 -lgstaudio-1.0 -lgstfft-1.0 -lEGL -Wl,-rpath,/builddir/build/BUILD/webkitgtk-2.7.90/x86_64-redhat-linux-gnu/lib:
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp:63: error: undefined reference to 'XGetErrorText'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp:102: error: undefined reference to 'XSetErrorHandler'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp:102: error: undefined reference to 'XSetErrorHandler'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:235: error: undefined reference to 'XFreePixmap'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:221: error: undefined reference to 'XResizeWindow'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:222: error: undefined reference to 'XFlush'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:250: error: undefined reference to 'XCompositeNameWindowPixmap'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:257: error: undefined reference to 'XGetWindowAttributes'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:259: error: undefined reference to 'XFreePixmap'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:147: error: undefined reference to 'XCreateColormap'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:158: error: undefined reference to 'XCreateWindow'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:167: error: undefined reference to 'XMapWindow'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:172: error: undefined reference to 'XCreateWindow'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:183: error: undefined reference to 'XMapWindow'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:185: error: undefined reference to 'XFreeColormap'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:191: error: undefined reference to 'XWindowEvent'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:195: error: undefined reference to 'XSelectInput'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:196: error: undefined reference to 'XCompositeRedirectWindow'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:197: error: undefined reference to 'XDamageCreate'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:113: error: undefined reference to 'XDamageQueryExtension'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:117: error: undefined reference to 'XCompositeQueryExtension'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:122: error: undefined reference to 'XCompositeQueryVersion'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:209: error: undefined reference to 'XDamageDestroy'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:210: error: undefined reference to 'XDestroyWindow'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:211: error: undefined reference to 'XDestroyWindow'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/UIProcess/gtk/RedirectedXCompositeWindow.cpp:83: error: undefined reference to 'XDamageSubtract'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:154: error: undefined reference to 'XCreateColormap'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:159: error: undefined reference to 'XFlush'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:184: error: undefined reference to 'XGetVisualInfo'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:188: error: undefined reference to 'XFree'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:191: error: undefined reference to 'XCreateColormap'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:237: error: undefined reference to 'XFreeColormap'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:241: error: undefined reference to 'XFreePixmap'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:279: error: undefined reference to 'XCreatePixmap'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:272: error: undefined reference to 'XFreePixmap'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:329: error: undefined reference to 'XSync'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:281: error: undefined reference to 'XSync'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/cairo/BackingStoreBackendCairoX11.cpp:48: error: undefined reference to 'XFreeGC'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/cairo/BackingStoreBackendCairoX11.cpp:70: error: undefined reference to 'XCopyArea'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/cairo/BackingStoreBackendCairoX11.cpp:36: error: undefined reference to 'XCreatePixmap'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/cairo/BackingStoreBackendCairoX11.cpp:37: error: undefined reference to 'XCreateGC'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/GLContext.cpp:83: error: undefined reference to 'XOpenDisplay'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/GLContext.cpp:91: error: undefined reference to 'XCloseDisplay'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp:190: error: undefined reference to 'XCreatePixmap'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:230: error: undefined reference to 'XGetGeometry'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:39: error: undefined reference to 'XGetWindowAttributes'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:43: error: undefined reference to 'XVisualIDFromVisual'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:46: error: undefined reference to 'XGetVisualInfo'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:50: error: undefined reference to 'XFree'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:92: error: undefined reference to 'XFree'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:87: error: undefined reference to 'XFree'
/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:127: error: undefined reference to 'XCreatePixmap'

With cmake 3.1.x, cmake detected the X11 on its own (and set the X11_X11_LIB variable), but it is not happening with 3.2.x.. As a workaround we need to explicitly call the find_package(X11) in Source/cmake/OptionsGTK.cmake when the X11 target is enabled.
Comment 1 Tomas Popela 2015-02-19 05:11:41 PST
Created attachment 246890 [details]
Patch
Comment 2 Tomas Popela 2015-02-19 06:49:29 PST
Comment on attachment 246890 [details]
Patch

Removing the flags as the clean build started failing on various places (with cmake 3.2.x).. If anyone have some ideas..

[ 15%] Generating ../../DerivedSources/WebCore/CSSPropertyNames.in, ../../DerivedSources/WebCore/CSSPropertyNames.h, ../../DerivedSources/WebCore/CSSPropertyNames.cpp, ../../DerivedSources/WebCore/CSSPropertyNames.gperf, ../../DerivedSources/WebCore/StyleBuilder.cpp, ../../DerivedSources/WebCore/StylePropertyShorthandFunctions.h, ../../DerivedSources/WebCore/StylePropertyShorthandFunctions.cpp
cd /builddir/build/BUILD/webkitgtk-2.7.90/x86_64-redhat-linux-gnu/DerivedSources/WebCore && /usr/bin/perl -ne print /builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/css/CSSPropertyNames.in > /builddir/build/BUILD/webkitgtk-2.7.90/x86_64-redhat-linux-gnu/DerivedSources/WebCore/CSSPropertyNames.in
cd /builddir/build/BUILD/webkitgtk-2.7.90/x86_64-redhat-linux-gnu/DerivedSources/WebCore && /usr/bin/perl -I/builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/bindings/scripts /builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/css/makeprop.pl --defines " ENABLE_3D_RENDERING ENABLE_ACCELERATED_2D_CANVAS ENABLE_ACCESSIBILITY ENABLE_CHANNEL_MESSAGING ENABLE_CONTEXT_MENUS ENABLE_CSS_BOX_DECORATION_BREAK ENABLE_CSS_IMAGE_SET ENABLE_CSS_REGIONS ENABLE_CSS_SELECTORS_LEVEL4 ENABLE_DETAILS_ELEMENT ENABLE_DRAG_SUPPORT ENABLE_FULLSCREEN_API ENABLE_GEOLOCATION ENABLE_ICONDATABASE ENABLE_INPUT_TYPE_COLOR ENABLE_JIT ENABLE_LEGACY_VENDOR_PREFIXES ENABLE_MATHML ENABLE_MEDIA_CONTROLS_SCRIPT ENABLE_MEMORY_SAMPLER ENABLE_METER_ELEMENT ENABLE_MHTML ENABLE_NAVIGATOR_HWCONCURRENCY ENABLE_NETSCAPE_PLUGIN_API ENABLE_NETWORK_PROCESS ENABLE_NOTIFICATIONS ENABLE_PICTURE_SIZES ENABLE_PROMISES ENABLE_REQUEST_ANIMATION_FRAME ENABLE_SATURATED_LAYOUT_ARITHMETIC ENABLE_SPELLCHECK ENABLE_STREAMS_API ENABLE_SVG_FONTS ENABLE_TEMPLATE_ELEMENT ENABLE_TOUCH_EVENTS ENABLE_USERSELECT_ALL ENABLE_USER_MESSAGE_HANDLERS ENABLE_VIDEO ENABLE_VIDEO_TRACK ENABLE_VIEW_MODE_CSS_MEDIA ENABLE_WEB_AUDIO ENABLE_WEB_SOCKETS ENABLE_WEB_TIMING ENABLE_WEBGL ENABLE_XHR_TIMEOUT ENABLE_XSLT ENABLE_PLUGIN_PROCESS_GTK2" --preprocessor "/usr/bin/c++ -E -P -x c++"
CSSPropertyNames.gperf: No keywords in input file!
calling gperf failed: 256 at /builddir/build/BUILD/webkitgtk-2.7.90/Source/WebCore/css/makeprop.pl line 1032.
Source/WebCore/CMakeFiles/WebCore.dir/build.make:155: recipe for target 'DerivedSources/WebCore/CSSPropertyNames.in' failed

OR

Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/build.make:245: recipe for target 'DerivedSources/JavaScriptCore/inspector/InspectorBackendDispatchers.cpp' failed
[  4%] make[2]: *** [DerivedSources/JavaScriptCore/inspector/InspectorBackendDispatchers.cpp] Error 1
Comment 3 Martin Robinson 2015-02-19 08:54:01 PST
(In reply to comment #2)

> Source/WebCore/CMakeFiles/WebCore.dir/build.make:155: recipe for target
> 'DerivedSources/WebCore/CSSPropertyNames.in' failed
> 
> OR
> 
> Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/build.make:245: recipe
> for target
> 'DerivedSources/JavaScriptCore/inspector/InspectorBackendDispatchers.cpp'
> failed
> [  4%] make[2]: ***
> [DerivedSources/JavaScriptCore/inspector/InspectorBackendDispatchers.cpp]
> Error 1

To be honest, that failure looks unrelated to your patch.
Comment 4 Tomas Popela 2015-02-19 09:05:27 PST
(In reply to comment #3)
> To be honest, that failure looks unrelated to your patch.

I know Martin, but before I applied that patch the build failed on the very end as it is showed in comment #1
Comment 5 Tomas Popela 2015-02-22 23:20:09 PST
As per https://bugzilla.redhat.com/show_bug.cgi?id=1194260#c3 the patch is valid. The build issue is probably another bug.

Deprecated and Removed Features:

* The "FindOpenGL" module no longer explicitly searches for any
  dependency on X11 libraries with the "FindX11" module.  Such
  dependencies should not need to be explicit. Applications using X11
  APIs themselves should find and link to X11 libraries explicitly.
Comment 6 WebKit Commit Bot 2015-02-23 08:06:19 PST
Comment on attachment 246890 [details]
Patch

Clearing flags on attachment: 246890

Committed r180502: <http://trac.webkit.org/changeset/180502>
Comment 7 WebKit Commit Bot 2015-02-23 08:06:31 PST
All reviewed patches have been landed.  Closing bug.