After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787964 - gl: build error with mesa 17.2.0 and Meson
gl: build error with mesa 17.2.0 and Meson
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.12.2
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-09-20 22:27 UTC by rezso
Modified: 2018-01-16 11:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
meson log (9.00 KB, application/gzip)
2017-09-22 00:41 UTC, rezso
Details

Description rezso 2017-09-20 22:27:46 UTC
[75/633] Compiling C object 'gst-libs/gst/gl/gstgl-1.0@sha/gstglapi.c.o'.
FAILED: gst-libs/gst/gl/gstgl-1.0@sha/gstglapi.c.o 
ccache cc  -Igst-libs/gst/gl/gstgl-1.0@sha -Igst-libs/gst/gl -I../gst-libs/gst/gl -I. -I../ -Igst-libs -I../gst-libs -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libdrm -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -fPIC -pthread -DHAVE_CONFIG_H -DGST_USE_UNSTABLE_API -DGST_EXPORTS -MMD -MQ 'gst-libs/gst/gl/gstgl-1.0@sha/gstglapi.c.o' -MF 'gst-libs/gst/gl/gstgl-1.0@sha/gstglapi.c.o.d' -o 'gst-libs/gst/gl/gstgl-1.0@sha/gstglapi.c.o' -c ../gst-libs/gst/gl/gstglapi.c
In file included from /usr/include/GL/gl.h:2055:0,
                 from ../gst-libs/gst/gl/gstglapi.h:65,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GL/glext.h:466:19: error: conflicting types for ‘GLsizeiptr’
 typedef ptrdiff_t GLsizeiptr;
                   ^~~~~~~~~~
In file included from ../gst-libs/gst/gl/gstglapi.h:40:0,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GLES3/gl3.h:75:25: note: previous declaration of ‘GLsizeiptr’ was here
 typedef khronos_ssize_t GLsizeiptr;
                         ^~~~~~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from ../gst-libs/gst/gl/gstglapi.h:65,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GL/glext.h:467:19: error: conflicting types for ‘GLintptr’
 typedef ptrdiff_t GLintptr;
                   ^~~~~~~~
In file included from ../gst-libs/gst/gl/gstglapi.h:40:0,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GLES3/gl3.h:76:26: note: previous declaration of ‘GLintptr’ was here
 typedef khronos_intptr_t GLintptr;
                          ^~~~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from ../gst-libs/gst/gl/gstglapi.h:65,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GL/glext.h:530:25: error: conflicting types for ‘PFNGLBUFFERDATAPROC’
 typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
                         ^~~~~~~~~~~~~~~~~~~
In file included from ../gst-libs/gst/gl/gstglapi.h:40:0,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GLES3/gl3.h:395:28: note: previous declaration of ‘PFNGLBUFFERDATAPROC’ was here
 typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
                            ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from ../gst-libs/gst/gl/gstglapi.h:65,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GL/glext.h:531:25: error: conflicting types for ‘PFNGLBUFFERSUBDATAPROC’
 typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
                         ^~~~~~~~~~~~~~~~~~~~~~
In file included from ../gst-libs/gst/gl/gstglapi.h:40:0,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GLES3/gl3.h:396:28: note: previous declaration of ‘PFNGLBUFFERSUBDATAPROC’ was here
 typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
                            ^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from ../gst-libs/gst/gl/gstglapi.h:65,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GL/glext.h:1126:25: error: conflicting types for ‘PFNGLBINDBUFFERRANGEPROC’
 typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
                         ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../gst-libs/gst/gl/gstglapi.h:40:0,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GLES3/gl3.h:1030:28: note: previous declaration of ‘PFNGLBINDBUFFERRANGEPROC’ was here
 typedef void (GL_APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
                            ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from ../gst-libs/gst/gl/gstglapi.h:65,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GL/glext.h:1196:26: error: conflicting types for ‘PFNGLMAPBUFFERRANGEPROC’
 typedef void *(APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
                          ^~~~~~~~~~~~~~~~~~~~~~~
In file included from ../gst-libs/gst/gl/gstglapi.h:40:0,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GLES3/gl3.h:1021:29: note: previous declaration of ‘PFNGLMAPBUFFERRANGEPROC’ was here
 typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
                             ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from ../gst-libs/gst/gl/gstglapi.h:65,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GL/glext.h:1197:25: error: conflicting types for ‘PFNGLFLUSHMAPPEDBUFFERRANGEPROC’
 typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../gst-libs/gst/gl/gstglapi.h:40:0,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GLES3/gl3.h:1022:28: note: previous declaration of ‘PFNGLFLUSHMAPPEDBUFFERRANGEPROC’ was here
 typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from ../gst-libs/gst/gl/gstglapi.h:65,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GL/glext.h:1357:25: error: conflicting types for ‘PFNGLCOPYBUFFERSUBDATAPROC’
 typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../gst-libs/gst/gl/gstglapi.h:40:0,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GLES3/gl3.h:1056:28: note: previous declaration of ‘PFNGLCOPYBUFFERSUBDATAPROC’ was here
 typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../gst-libs/gst/gl/gstglapi.h:81:0,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
../gst-libs/gst/gl/glprototypes/gstgl_compat.h:40:18: error: conflicting types for ‘GLsync’
 typedef gpointer GLsync;
                  ^~~~~~
In file included from /usr/include/GL/gl.h:2055:0,
                 from ../gst-libs/gst/gl/gstglapi.h:65,
                 from ../gst-libs/gst/gl/gstglapi.c:34:
/usr/include/GL/glext.h:1383:26: note: previous declaration of ‘GLsync’ was here
 typedef struct __GLsync *GLsync;
                          ^~~~~~
[76/633] Generating symbol file 'gst-libs/gst/video/gstbadvideo-1.0@sha/gst-libs/gst/video/libgstbadvideo-1.0.so.0.1203.0.symbols'.
ninja: build stopped: subcommand failed.

How to fix this?
Comment 1 Matthew Waters (ystreet00) 2017-09-21 00:51:54 UTC
There is some detection for this case at https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gst/gl/meson.build#n366

You'll have to look through the meson log in your build directory for why it doesn't detect your case.  Or attach the log file here.

A workaround is to explicitly disable gles2 or opengl support with 'meson -Dwith_gl_api=opengl' (or gles2).
Comment 2 Matthew Waters (ystreet00) 2017-09-21 00:52:39 UTC
As another data point, I'm currently running mesa 17.2.0 and everything builds fine here.
Comment 3 rezso 2017-09-22 00:07:17 UTC
I currently built with -Dwith_gl_api=opengl option, but I don't know the reason.
But I found a similar, solved problem with freshplayerplugin:
https://github.com/i-rinat/freshplayerplugin/issues/236
Comment 4 rezso 2017-09-22 00:41:59 UTC
Created attachment 360237 [details]
meson log
Comment 5 Matthew Waters (ystreet00) 2017-09-22 02:53:00 UTC
So this is a build definition error using prefix in cc.compiles() at https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gst/gl/meson.build?id=980ddfdfb740107ce8d9db3f8679d235af757412#n366

Upstream meson bug: https://github.com/mesonbuild/meson/issues/2364
Comment 6 Tim-Philipp Müller 2017-12-28 10:14:44 UTC
Seeing that there is little movement on the upstream meson bug perhaps we should fix the meson.build then?

Just

-  if not cc.compiles('void f (void) {}', prefix : gl_include_block, ...
+  if not cc.compiles(gl_include_block + '\n' + 'void f (void) {}', ...

should do the trick right?
Comment 7 Nirbheek Chauhan 2017-12-30 01:33:30 UTC
Yes, that should fix it and will continue to work regardless of what upstream decides to do.
Comment 8 Tim-Philipp Müller 2018-01-16 11:29:25 UTC
commit df0831ce57dc28b8cee9133378fb0f23977fc44c (HEAD -> master)
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Tue Jan 16 11:25:29 2018 +0000

    meson: fix check whether both gles2 and opengl headers can be included
    
    cc.compiles() doesn't support the prefix: kwarg currently, so it
    never had any effect.
    
    https://github.com/mesonbuild/meson/issues/2364
    https://bugzilla.gnome.org/show_bug.cgi?id=787964

Will also pick into 1.12 once build bots are happy.