Bug 200223

Summary: [GTK] Compilation errors when GL is disabled
Product: WebKit Reporter: Kam Amini <k.amini>
Component: WebKitGTKAssignee: Michael Catanzaro <mcatanzaro>
Status: RESOLVED FIXED    
Severity: Major CC: bugs-noreply, commit-queue, mcatanzaro, pnormand, yurys
Priority: P2 Keywords: Gtk
Version: WebKit Local Build   
Hardware: All   
OS: Linux   
Attachments:
Description Flags
Patch none

Kam Amini
Reported 2019-07-29 06:04:56 PDT
Hello, I receive the following compilation error when the GL support is off. I'm compiling 2.24.3 on a CentOS machine. > In file included from /usr/include/glib-2.0/gobject/gobject.h:28:0, > from /usr/include/glib-2.0/gobject/gbinding.h:29, > from /usr/include/glib-2.0/glib-object.h:23, > from /opt/activevideo/webkit-dependencies/include/gstreamer-1.0/gst/gstenumtypes.h:7, > from /opt/activevideo/webkit-dependencies/include/gstreamer-1.0/gst/gst.h:31, > from ../Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h:24, > from ../Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h:24, > from ../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:29, > from ../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:27: > ../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: In lambda function: > ../Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:2530:17: error: ‘class WebCore::MediaPlayerPrivateGStreamer’ has no member named ‘updateTextureMapperFlags’ > player->updateTextureMapperFlags(); > ^ > [12/1006] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp.o Root Cause: The issue is apparent in the following sources. The `updateTextureMapperFlags` is defined only when `TEXTURE_MAPPER_GL` is used. Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:247 246 #if USE(TEXTURE_MAPPER_GL) 247 void updateTextureMapperFlags(); 248 TextureMapperGL::Flags m_textureMapperFlags; 249 #endif The following is the definition of the function: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:964 963 #if USE(TEXTURE_MAPPER_GL) 964 void MediaPlayerPrivateGStreamerBase::updateTextureMapperFlags() 965 { 966 switch (m_videoSourceOrientation) { 967 case DefaultImageOrientation: 968 m_textureMapperFlags = 0; And the following is the usage of the function which does not check the `TEXTURE_MAPPER_GL` macro to be set. Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:2491 2489 player->m_videoDecoderPlatform = WebKitGstVideoDecoderPlatform::ImxVPU; 2490 2491 player->updateTextureMapperFlags(); 2492 }), this); Thanks in advance. Best regards, Kam
Attachments
Patch (1.92 KB, patch)
2019-09-18 13:17 PDT, Yury Semikhatsky
no flags
Philippe Normand
Comment 1 2019-07-29 08:29:10 PDT
Hi Kam, Can you clarify the full list of CMake arguments you use please?
Michael Catanzaro
Comment 2 2019-07-29 08:29:37 PDT
Can you confirm that adding the #if USE(TEXTURE_MAPPER_GL) guard around the call to player->updateTextureMapperFlags() is sufficient to fix the build, or is there a subsequent issue?
Philippe Normand
Comment 3 2019-07-30 02:19:12 PDT
Reproducer: cmake ~/WebKit -DPORT=GTK -DENABLE_OPENGL=OFF ninja
Kam Amini
Comment 4 2019-07-30 02:32:07 PDT
Thanks @Philip for the reproduction commands. I'll place the macro around that line and let you know @Michael.
Philippe Normand
Comment 5 2019-07-30 02:34:45 PDT
This is beyond GStreamer: In file included from /usr/include/X11/Xlib.h:44, from /usr/include/gtk-3.0/gdk/gdkx.h:30, from /home/phil/WebKit/Source/WebCore/platform/graphics/PlatformDisplay.cpp:54, from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:2: DerivedSources/ForwardingHeaders/wtf/Threading.h:75:5: error: expected identifier before numeric constant None = 0, ^~~~ DerivedSources/ForwardingHeaders/wtf/Threading.h:75:5: error: expected ‘}’ before numeric constant In file included from DerivedSources/ForwardingHeaders/wtf/WeakPtr.h:33, from /home/phil/WebKit/Source/WebCore/platform/graphics/FontCascade.h:34, from /home/phil/WebKit/Source/WebCore/platform/graphics/GraphicsContext.h:31, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.h:38, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:34, from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:4: DerivedSources/ForwardingHeaders/wtf/Threading.h:74:35: note: to match this ‘{’ enum class GCThreadType : uint8_t { ^ In file included from /usr/include/X11/Xlib.h:44, from /usr/include/gtk-3.0/gdk/gdkx.h:30, from /home/phil/WebKit/Source/WebCore/platform/graphics/PlatformDisplay.cpp:54, from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:2: DerivedSources/ForwardingHeaders/wtf/Threading.h:75:5: error: expected unqualified-id before numeric constant None = 0, ^~~~ In file included from DerivedSources/ForwardingHeaders/wtf/WeakPtr.h:33, from /home/phil/WebKit/Source/WebCore/platform/graphics/FontCascade.h:34, from /home/phil/WebKit/Source/WebCore/platform/graphics/GraphicsContext.h:31, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.h:38, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:34, from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:4: DerivedSources/ForwardingHeaders/wtf/Threading.h:147:53: error: ‘GCThreadType’ has not been declared WTF_EXPORT_PRIVATE static void registerGCThread(GCThreadType); ^~~~~~~~~~~~ DerivedSources/ForwardingHeaders/wtf/Threading.h:203:5: error: ‘GCThreadType’ does not name a type; did you mean ‘GThreadPool’? GCThreadType gcThreadType() const { return static_cast<GCThreadType>(m_gcThreadType); } ^~~~~~~~~~~~ GThreadPool DerivedSources/ForwardingHeaders/wtf/Threading.h:216:42: error: ‘PlatformThreadHandle’ has not been declared void establishPlatformSpecificHandle(PlatformThreadHandle); ^~~~~~~~~~~~~~~~~~~~ In file included from DerivedSources/ForwardingHeaders/wtf/WeakPtr.h:33, from /home/phil/WebKit/Source/WebCore/platform/graphics/FontCascade.h:34, from /home/phil/WebKit/Source/WebCore/platform/graphics/GraphicsContext.h:31, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.h:38, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:34, from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:4: DerivedSources/ForwardingHeaders/wtf/Threading.h:248:5: error: ‘ThreadGroupAddResult’ does not name a type; did you mean ‘ThreadGroup’? ThreadGroupAddResult addToThreadGroup(const AbstractLocker& threadGroupLocker, ThreadGroup&); ^~~~~~~~~~~~~~~~~~~~ ThreadGroup DerivedSources/ForwardingHeaders/wtf/Threading.h:249:73: error: ‘ThreadGroup’ has not been declared void removeFromThreadGroup(const AbstractLocker& threadGroupLocker, ThreadGroup&); ^~~~~~~~~~~ DerivedSources/ForwardingHeaders/wtf/Threading.h:257:31: error: ‘ThreadSpecificKey’ does not name a type; did you mean ‘ThreadSafeRefCounted’? static WTF_EXPORT_PRIVATE ThreadSpecificKey s_key; ^~~~~~~~~~~~~~~~~ ThreadSafeRefCounted DerivedSources/ForwardingHeaders/wtf/Threading.h:293:26: error: ‘ThreadGroup’ was not declared in this scope Vector<std::weak_ptr<ThreadGroup>> m_threadGroups; ^~~~~~~~~~~ DerivedSources/ForwardingHeaders/wtf/Threading.h:293:26: note: suggested alternative: In file included from DerivedSources/ForwardingHeaders/wtf/WeakPtr.h:33, from /home/phil/WebKit/Source/WebCore/platform/graphics/FontCascade.h:34, from /home/phil/WebKit/Source/WebCore/platform/graphics/GraphicsContext.h:31, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.h:38, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:34, from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:4: DerivedSources/ForwardingHeaders/wtf/Threading.h:61:7: note: ‘WTF::ThreadGroup’ class ThreadGroup; ^~~~~~~~~~~ In file included from DerivedSources/ForwardingHeaders/wtf/WeakPtr.h:33, from /home/phil/WebKit/Source/WebCore/platform/graphics/FontCascade.h:34, from /home/phil/WebKit/Source/WebCore/platform/graphics/GraphicsContext.h:31, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.h:38, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:34, from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:4: DerivedSources/ForwardingHeaders/wtf/Threading.h:293:26: error: template argument 1 is invalid Vector<std::weak_ptr<ThreadGroup>> m_threadGroups; ^~~~~~~~~~~ DerivedSources/ForwardingHeaders/wtf/Threading.h:293:37: error: template argument 1 is invalid Vector<std::weak_ptr<ThreadGroup>> m_threadGroups; ^~ DerivedSources/ForwardingHeaders/wtf/Threading.h:294:5: error: ‘PlatformThreadHandle’ does not name a type PlatformThreadHandle m_handle; ^~~~~~~~~~~~~~~~~~~~ DerivedSources/ForwardingHeaders/wtf/Threading.h: In constructor ‘Thread::Thread()’: DerivedSources/ForwardingHeaders/wtf/Threading.h:321:44: error: ‘GCThreadType’ has not been declared , m_gcThreadType(static_cast<unsigned>(GCThreadType::None)) ^~~~~~~~~~~~ In file included from /usr/include/X11/Xlib.h:44, from /usr/include/gtk-3.0/gdk/gdkx.h:30, from /home/phil/WebKit/Source/WebCore/platform/graphics/PlatformDisplay.cpp:54, from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:2: DerivedSources/ForwardingHeaders/wtf/Threading.h:321:58: error: expected unqualified-id before numeric constant , m_gcThreadType(static_cast<unsigned>(GCThreadType::None)) ^~~~ In file included from DerivedSources/ForwardingHeaders/wtf/WeakPtr.h:33, from /home/phil/WebKit/Source/WebCore/platform/graphics/FontCascade.h:34, from /home/phil/WebKit/Source/WebCore/platform/graphics/GraphicsContext.h:31, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.h:38, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:34, from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:4: DerivedSources/ForwardingHeaders/wtf/Threading.h:321:58: error: expected ‘)’ before numeric constant , m_gcThreadType(static_cast<unsigned>(GCThreadType::None)) ^ ) DerivedSources/ForwardingHeaders/wtf/Threading.h:321:63: error: expected ‘{’ before ‘)’ token , m_gcThreadType(static_cast<unsigned>(GCThreadType::None)) ^ DerivedSources/ForwardingHeaders/wtf/Threading.h: At global scope: DerivedSources/ForwardingHeaders/wtf/Threading.h:321:63: error: expected unqualified-id before ‘)’ token DerivedSources/ForwardingHeaders/wtf/Threading.h: In static member function ‘static Thread* Thread::currentMayBeNull()’: DerivedSources/ForwardingHeaders/wtf/Threading.h:329:51: error: ‘s_key’ was not declared in this scope return static_cast<Thread*>(threadSpecificGet(s_key)); ^~~~~ DerivedSources/ForwardingHeaders/wtf/Threading.h:329:51: note: suggested alternative: ‘si_pkey’ return static_cast<Thread*>(threadSpecificGet(s_key)); ^~~~~ si_pkey DerivedSources/ForwardingHeaders/wtf/Threading.h:329:33: error: ‘threadSpecificGet’ was not declared in this scope return static_cast<Thread*>(threadSpecificGet(s_key)); ^~~~~~~~~~~~~~~~~ DerivedSources/ForwardingHeaders/wtf/Threading.h:329:33: note: suggested alternative: In file included from DerivedSources/ForwardingHeaders/wtf/MainThread.h:35, from DerivedSources/ForwardingHeaders/wtf/ThreadSafeRefCounted.h:30, from DerivedSources/ForwardingHeaders/wtf/FunctionDispatcher.h:29, from DerivedSources/ForwardingHeaders/wtf/RunLoop.h:33, from DerivedSources/ForwardingHeaders/pal/HysteresisActivity.h:28, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/BackingStoreBackendCairoImpl.h:23, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp:21, from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:3: DerivedSources/ForwardingHeaders/wtf/ThreadingPrimitives.h:143:14: note: ‘WTF::threadSpecificGet’ inline void* threadSpecificGet(ThreadSpecificKey key) ^~~~~~~~~~~~~~~~~ In file included from DerivedSources/ForwardingHeaders/wtf/Platform.h:31, from /home/phil/WebKit/Source/WebCore/config.h:26, from /home/phil/WebKit/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp:20, from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:1: DerivedSources/ForwardingHeaders/wtf/Threading.h: In static member function ‘static Thread& Thread::current()’: DerivedSources/ForwardingHeaders/wtf/Threading.h:344:26: error: ‘s_key’ is not a member of ‘Thread’ if (UNLIKELY(Thread::s_key == InvalidThreadSpecificKey)) ^~~~~ DerivedSources/ForwardingHeaders/wtf/Compiler.h:341:41: note: in definition of macro ‘UNLIKELY’ #define UNLIKELY(x) __builtin_expect(!!(x), 0) ^ DerivedSources/ForwardingHeaders/wtf/Threading.h:344:35: error: ‘InvalidThreadSpecificKey’ was not declared in this scope if (UNLIKELY(Thread::s_key == InvalidThreadSpecificKey)) ^~~~~~~~~~~~~~~~~~~~~~~~ DerivedSources/ForwardingHeaders/wtf/Compiler.h:341:41: note: in definition of macro ‘UNLIKELY’ #define UNLIKELY(x) __builtin_expect(!!(x), 0) ^ DerivedSources/ForwardingHeaders/wtf/Threading.h:344:35: note: suggested alternative: if (UNLIKELY(Thread::s_key == InvalidThreadSpecificKey)) ^~~~~~~~~~~~~~~~~~~~~~~~ DerivedSources/ForwardingHeaders/wtf/Compiler.h:341:41: note: in definition of macro ‘UNLIKELY’ #define UNLIKELY(x) __builtin_expect(!!(x), 0) ^ In file included from DerivedSources/ForwardingHeaders/wtf/MainThread.h:35, from DerivedSources/ForwardingHeaders/wtf/ThreadSafeRefCounted.h:30, from DerivedSources/ForwardingHeaders/wtf/FunctionDispatcher.h:29, from DerivedSources/ForwardingHeaders/wtf/RunLoop.h:33, from DerivedSources/ForwardingHeaders/pal/HysteresisActivity.h:28, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/BackingStoreBackendCairoImpl.h:23, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp:21, from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:3: DerivedSources/ForwardingHeaders/wtf/ThreadingPrimitives.h:122:36: note: ‘WTF::InvalidThreadSpecificKey’ static constexpr ThreadSpecificKey InvalidThreadSpecificKey = PTHREAD_KEYS_MAX; ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from DerivedSources/ForwardingHeaders/wtf/WeakPtr.h:33, from /home/phil/WebKit/Source/WebCore/platform/graphics/FontCascade.h:34, from /home/phil/WebKit/Source/WebCore/platform/graphics/GraphicsContext.h:31, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.h:38, from /home/phil/WebKit/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp:34, from DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:4: DerivedSources/ForwardingHeaders/wtf/Threading.h: At global scope: DerivedSources/ForwardingHeaders/wtf/Threading.h:356:1: error: expected declaration before ‘}’ token } // namespace WTF ^
Michael Catanzaro
Comment 6 2019-07-30 08:25:47 PDT
(In reply to Philippe Normand from comment #5) > This is beyond GStreamer: > > In file included from /usr/include/X11/Xlib.h:44, > from /usr/include/gtk-3.0/gdk/gdkx.h:30, > from > /home/phil/WebKit/Source/WebCore/platform/graphics/PlatformDisplay.cpp:54, > from > DerivedSources/WebCore/unified-sources/UnifiedSource-3c72abbe-24.cpp:2: > DerivedSources/ForwardingHeaders/wtf/Threading.h:75:5: error: expected > identifier before numeric constant > None = 0, > ^~~~ Files including Xlib.h must be excluded from unified build. Solution is to add @no-unify to PlatformDisplay.cpp in Sources.txt. If you're bored or have 25 hours today, you could git grep to try to find every .cpp that includes gdkx.h and Xlib.h and mark them all as @no-unify.
Michael Catanzaro
Comment 7 2019-07-30 08:26:57 PDT
Actually I have time today to take this.
Michael Catanzaro
Comment 8 2019-07-30 09:16:53 PDT
I tested the tarball, and these guards are all that's needed there. I'll check trunk next; I expect to see Phil's errors on trunk.
Michael Catanzaro
Comment 9 2019-07-30 09:17:42 PDT
Michael Catanzaro
Comment 10 2019-07-30 09:28:41 PDT
BTW the eventual 2.24.4 tarball will contain this fix, thanks for reporting.
Michael Catanzaro
Comment 11 2019-07-30 10:29:02 PDT
Michael Catanzaro
Comment 12 2019-07-30 10:31:06 PDT
Reopening since fixing trunk requires thinking, and I'm not good at that. We have: In file included from DerivedSources/WebKit/unified-sources/UnifiedSource-88d1702b-25.cpp:3: /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp: In member function ‘void WebKit::WebProcessPool::platformInitializeWebProcess(const WebKit::WebProcessProxy&, WebKit::WebProcessCreationParameters&)’: /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp:123:51: error: ‘WaylandCompositor’ has not been declared 123 | parameters.waylandCompositorDisplayName = WaylandCompositor::singleton().displayName(); | ^~~~~~~~~~~~~~~~~ So WebProcessPoolGLib.cpp requires WaylandCompositor because PLATFORM(WAYLAND) is true but USE(WPE_RENDERER) is false. Problem is WaylandCompositor.h is guarded by #if PLATFORM(WAYLAND) && USE(EGL) && !USE(WPE_RENDERER). Carlos Garcia might know what to do.
Kam Amini
Comment 13 2019-07-31 01:34:14 PDT
(In reply to Michael Catanzaro from comment #10) > BTW the eventual 2.24.4 tarball will contain this fix, thanks for reporting. Thank you for the quick fix. I'll wait until the bug is fully resolved.
Yury Semikhatsky
Comment 14 2019-09-18 13:17:25 PDT
WebKit Commit Bot
Comment 15 2019-09-18 19:34:56 PDT
Comment on attachment 379065 [details] Patch Clearing flags on attachment: 379065 Committed r250077: <https://trac.webkit.org/changeset/250077>
WebKit Commit Bot
Comment 16 2019-09-18 19:34:57 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.