GNOME Bugzilla – Bug 788695
mutter master fails to compile due to gl includes, since commit c9259c2b153d4d8e2bbc2055e175dce87ebfd43a
Last modified: 2017-11-07 08:46:50 UTC
It seems to be due to a issue with gles3 My mesa is compiled with ./autogen.sh --prefix=$INSTALLDIR --enable-driglx-direct --enable-dri --with-dri-drivers=r200,radeon,nouveau,i915,i965,swrast --enable-osmesa --enable-xa --enable-glx-tls --enable-shared-dricore --enable-gles1 --enable-gles2 --with-gallium-drivers=nouveau,svga,r300,r600,swrast,radeonsi,virgl,swr --with-egl-platforms=x11,wayland,drm --enable-gbm --enable-shared-glapi --enable-gallium-egl --with-llvm-prefix=/usr/lib/llvm-3.9/ --with-llvm-shared-libs --with-vulkan-drivers=intel,radeon --libdir=$INSTALLDIR/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) (it seems that I can't just --enable-gles3 , like I can with 2 or 1) My Mutter is compiled with ./autogen.sh --prefix=$INSTALLDIR --libdir=$INSTALLDIR/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) --enable-compile-warnings=yes --with-xwayland-path=$INSTALLDIR/bin/Xwayland --disable-Werror --enable-egl-device And it produces a very long scrollback error /opt/include/wayland-server.h:63:8: note: declared here struct wl_buffer { ^~~~~~~~~ CC backends/native/meta-renderer-native.lo CC backends/native/meta-renderer-native-gles3.lo CC backends/native/meta-stage-native.lo CC backends/native/dbus-utils.lo CCLD mutter-restart-helper backends/native/meta-output-kms.c: In function ‘meta_create_kms_output’: backends/native/meta-output-kms.c:530:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (crtc->crtc_id == output_kms->current_encoder->crtc_id) ^~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:75:25: error: conflicting types for ‘GLsizeiptr’ typedef khronos_ssize_t GLsizeiptr; ^~~~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:466:19: note: previous declaration of ‘GLsizeiptr’ was here typedef ptrdiff_t GLsizeiptr; ^~~~~~~~~~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:76:26: error: conflicting types for ‘GLintptr’ typedef khronos_intptr_t GLintptr; ^~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:467:19: note: previous declaration of ‘GLintptr’ was here typedef ptrdiff_t GLintptr; ^~~~~~~~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:395:28: error: conflicting types for ‘PFNGLBUFFERDATAPROC’ typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); ^~~~~~~~~~~~~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:530:25: note: previous declaration of ‘PFNGLBUFFERDATAPROC’ was here typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); ^~~~~~~~~~~~~~~~~~~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:396:28: error: conflicting types for ‘PFNGLBUFFERSUBDATAPROC’ typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); ^~~~~~~~~~~~~~~~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:531:25: note: previous declaration of ‘PFNGLBUFFERSUBDATAPROC’ was here typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); ^~~~~~~~~~~~~~~~~~~~~~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:538:29: error: conflicting types for ‘glBufferData’ GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); ^~~~~~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:550:21: note: previous declaration of ‘glBufferData’ was here GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); ^~~~~~~~~~~~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:539:29: error: conflicting types for ‘glBufferSubData’ GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); ^~~~~~~~~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:551:21: note: previous declaration of ‘glBufferSubData’ was here GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); ^~~~~~~~~~~~~~~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:1021:29: error: conflicting types for ‘PFNGLMAPBUFFERRANGEPROC’ typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); ^~~~~~~~~~~~~~~~~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:1196:26: note: previous declaration of ‘PFNGLMAPBUFFERRANGEPROC’ was here typedef void *(APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); ^~~~~~~~~~~~~~~~~~~~~~~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:1022:28: error: conflicting types for ‘PFNGLFLUSHMAPPEDBUFFERRANGEPROC’ typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:1197:25: note: previous declaration of ‘PFNGLFLUSHMAPPEDBUFFERRANGEPROC’ was here typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:1030:28: error: conflicting types for ‘PFNGLBINDBUFFERRANGEPROC’ typedef void (GL_APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:1126:25: note: previous declaration of ‘PFNGLBINDBUFFERRANGEPROC’ was here typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:1056:28: error: conflicting types for ‘PFNGLCOPYBUFFERSUBDATAPROC’ typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); ^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:1357:25: note: previous declaration of ‘PFNGLCOPYBUFFERSUBDATAPROC’ was here typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); ^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:1126:30: error: conflicting types for ‘glMapBufferRange’ GL_APICALL void *GL_APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); ^~~~~~~~~~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:1281:22: note: previous declaration of ‘glMapBufferRange’ was here GLAPI void *APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); ^~~~~~~~~~~~~~~~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:1127:29: error: conflicting types for ‘glFlushMappedBufferRange’ GL_APICALL void GL_APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:1282:21: note: previous declaration of ‘glFlushMappedBufferRange’ was here GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:1135:29: error: conflicting types for ‘glBindBufferRange’ GL_APICALL void GL_APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); ^~~~~~~~~~~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:1211:21: note: previous declaration of ‘glBindBufferRange’ was here GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); ^~~~~~~~~~~~~~~~~ In file included from backends/native/meta-renderer-native-gles3.c:30:0: /opt/include/GLES3/gl3.h:1161:29: error: conflicting types for ‘glCopyBufferSubData’ GL_APICALL void GL_APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); ^~~~~~~~~~~~~~~~~~~ In file included from /opt/include/GL/gl.h:2055:0, from ../cogl/cogl/cogl-gl-header.h:41, from ../cogl/cogl/cogl-gles2.h:69, from ../cogl/cogl/winsys/cogl-winsys-private.h:36, from ../cogl/cogl/cogl-renderer-private.h:37, from ../cogl/cogl/cogl-mutter.h:41, from ../cogl/cogl/cogl.h:93, from ./backends/meta-monitor-manager-private.h:38, from ./backends/meta-gpu.h:27, from ./backends/native/meta-gpu-kms.h:29, from ./backends/native/meta-renderer-native-gles3.h:30, from backends/native/meta-renderer-native-gles3.c:27: /opt/include/GL/glext.h:1370:21: note: previous declaration of ‘glCopyBufferSubData’ was here GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); ^~~~~~~~~~~~~~~~~~~ Makefile:2226: recipe for target 'backends/native/meta-renderer-native-gles3.lo' failed make[4]: *** [backends/native/meta-renderer-native-gles3.lo] Error 1 make[4]: *** Waiting for unfinished jobs.... make[4]: Leaving directory '/srcbuild/mutter/src' Makefile:2361: recipe for target 'all-recursive' failed make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory '/srcbuild/mutter/src' Makefile:1402: recipe for target 'all' failed make[2]: *** [all] Error 2 make[2]: Leaving directory '/srcbuild/mutter/src' Makefile:484: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/srcbuild/mutter' Makefile:414: recipe for target 'all' failed make: *** [all] Error 2 PackageCompileSource finished in 127 seconds
Is there any more info I need to provide? it seems that I am still getting this build error
I tried with and without the --enable-egl-device flag, and get the same results
Which mesa version do you use ?
This is mutter master I was able to build Mutter before. I think this issue was introduced in a recentish commit
I just realized the question was about the MESA version. It's master, but I get the same thing with 17.3 and 17.2
Created attachment 362518 [details] [review] renderer-native-gles3: Don't pass GPU when rendering It wasn't used for anything, so don't pass it.
Created attachment 362519 [details] [review] renderer-native-gles3: Remove unnecessary includes They caused conflicts on i686 as GL/gl.h was included by cogl.
Created attachment 362520 [details] [review] renderer-native-gles3: Add cpp error out if gl.h was included On some architectures, including both GLES3/gl3.h GL/gl.h will cause compilation issues due to incompatible type definitions. To avoid running into that issue while building on other architectures, make sure we haven't included GL/gl.h by accident.
Haven't managed to get cross compilation to i686 working, but I hope these patches will fix the issue.
(In reply to Jonas Ådahl from comment #9) > Haven't managed to get cross compilation to i686 working, but I hope these > patches will fix the issue. They do: https://koji.fedoraproject.org/koji/watchlogs?taskID=22805496
Review of attachment 362518 [details] [review]: OK
Review of attachment 362519 [details] [review]: OK
Review of attachment 362520 [details] [review]: Looks good, except for the commit subject - should be either "Add cpp error if gl.h was included" or "Let cpp error out if gl.h was included" :-)
Those patches work! (It compiles in my 32 bit chroot!)
Pushed after fixing broken commit message.
*** Bug 790003 has been marked as a duplicate of this bug. ***