Bug 195800 - [GTK] [2.24.0] Build failure in Debian 9 (stretch)
Summary: [GTK] [2.24.0] Build failure in Debian 9 (stretch)
Status: RESOLVED DUPLICATE of bug 196178
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-15 05:49 PDT by Alberto Garcia
Modified: 2019-03-26 06:18 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alberto Garcia 2019-03-15 05:49:39 PDT
Here's the error message:

   In file included from Source/WebCore/platform/graphics/ANGLEWebKitBridge.h:56:0,
                    from Source/WebCore/platform/graphics/GraphicsContext3D.h:28,
                    from Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:32:
   Source/WebCore/platform/graphics/OpenGLShims.h:259:67: error: expected type-specifier before 'glActiveTexture'
    #define glActiveTexture                        LOOKUP_GL_FUNCTION(glActiveTexture)
                                                                      ^
   Source/WebCore/platform/graphics/OpenGLShims.h:259:67: error: expected initializer before 'glActiveTexture'
   Source/WebCore/platform/graphics/OpenGLShims.h:260:67: error: expected type-specifier before 'glAttachShader'
    #define glAttachShader                         LOOKUP_GL_FUNCTION(glAttachShader)
                                                                   ^

The problem seems to be that this bit from OpenGLShims.h:

   // We disable the shims for OpenGLShims.cpp, so that we can set them.
   #ifndef DISABLE_SHIMS
   #define LOOKUP_GL_FUNCTION(Function) WebCore::openGLFunctionTable()->Function
   #define glActiveTexture                        LOOKUP_GL_FUNCTION(glActiveTexture)
   #define glAttachShader                         LOOKUP_GL_FUNCTION(glAttachShader)
   #define glBindAttribLocation                   LOOKUP_GL_FUNCTION(glBindAttribLocation)
   #define glBindBuffer                           LOOKUP_GL_FUNCTION(glBindBuffer)
   /* ... */
   #endif

conflicts with declarations like this one from /usr/include/GLES3/gl3.h:

   GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);

and generates this incorrect declaration:

   void WebCore::openGLFunctionTable()->glActiveTexture(GLenum texture);

I haven't debugged this further and builds in Debian experimental work
fine, so perhaps this is just a bug in the Mesa headers.
Comment 1 Alberto Garcia 2019-03-15 16:43:20 PDT
Changing the order of the includes is enough to fix the build, but I
still haven't checked why this is not necessary on more recent
versions:

--- webkit2gtk-2.24.0.orig/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp       2019-03-13 09:21:39.000000000 +0000
+++ webkit2gtk-2.24.0/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp    2019-03-15 22:46:23.508214804 +0000
@@ -27,6 +27,10 @@

 #if ENABLE(VIDEO) && USE(GSTREAMER)

+#define GST_USE_UNSTABLE_API
+#include <gst/gl/gl.h>
+#undef GST_USE_UNSTABLE_API
+
 #include "GStreamerCommon.h"
 #include "GraphicsContext.h"
 #include "GraphicsContext3D.h"
@@ -81,10 +85,6 @@
 #endif // !GST_CHECK_VERSION(1, 14, 0)
 #endif // USE(LIBEPOXY)

-#define GST_USE_UNSTABLE_API
-#include <gst/gl/gl.h>
-#undef GST_USE_UNSTABLE_API
-
 #include "GLContext.h"
 #if USE(GLX)
 #include "GLContextGLX.h"
Comment 2 Philippe Normand 2019-03-26 04:44:53 PDT
Looks like a duplicate of bug #196178 ?
Comment 3 Alberto Garcia 2019-03-26 05:34:54 PDT
(In reply to Philippe Normand from comment #2)
> Looks like a duplicate of bug #196178 ?

Indeed.

And the patch proposed there should work. I was doing a similar
workaround in my tests, but including <gst/gl/gl.h> earlier instead of
"GraphicsContext3D.h" later.
Comment 4 Philippe Normand 2019-03-26 06:18:22 PDT

*** This bug has been marked as a duplicate of bug 196178 ***