including both GL/gl.h and cogl/cogl.h fails on armel and armhf

peter green plugwash at p10link.net
Sat Dec 31 00:03:57 UTC 2011


Toonloop failed to build on the armhf buildd

g++ -DHAVE_CONFIG_H -I.   -DBOOST_FILESYSTEM_VERSION=2 -O2 -Wall -Werror -Wextra -Wfatal-errors -pthread -I/usr/include -pthread -I/usr/include/clutter-1.0 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/cogl -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/libdrm -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/gstreamer-0.10 -I/usr/include/cairo -I/usr/include/libxml2   -pthread -I/usr/include/clutter-1.0 -I/usr/include/gtk-2.0 -I/usr/include/cogl -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/json-glib-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/libdrm -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/lib/arm-linux-gnueabihf/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo    -lm -lpthread -D__LINUX_ALSA__ -D__UNIX_JACK__ -D__LITTLE_ENDIAN__ -O2 -Wall -Werror -Wextra -Wfatal-errors -DPIXMAPS_DIR=\"/usr/share/pixmaps\" -O2 -Wall -Werror -Wextra -Wfatal-errors -c -o toonloop-application.o `test -f 'application.cpp' || echo './'`application.cpp
In file included from /usr/include/GL/gl.h:2091:0,
                 from /usr/include/GL/glx.h:45,
                 from gui.h:25,
                 from application.cpp:40:
/usr/include/GL/glext.h:5072:19: error: conflicting declaration 'typedef ptrdiff_t GLintptr'
compilation terminated due to -Wfatal-errors.
make[3]: *** [toonloop-application.o] Error 1
make[3]: Leaving directory `/build/buildd-toonloop_2.0.6-2-armhf-aVjbcs/toonloop-2.0.6/src'

I was able to reproduce the issue locally on armel as well despite the fact that the package
has been built successfully there in the past.

I have managed to reduce the problem to a simple testcase and mesa seems to be at fault.
To reproduce this issue create a file called test.c with the following contents

#include <stddef.h>
#include <GL/gl.h>
#include <cogl/cogl.h>

int main() {
}

And build it on armel or armhf with

g++ `pkg-config --cflags glib-2.0` -I/usr/include/cogl test.c

This fails on armel and armhf with the following error. It succeeds on i386

In file included from /usr/include/cogl/cogl/cogl-defines.h:33:0,
                 from /usr/include/cogl/cogl/cogl.h:44,
                 from test.c:4:
/usr/include/GLES2/gl2.h:38:26: error: conflicting declaration 'typedef 
khronos_intptr_t GLintptr'
/usr/include/GL/glext.h:5072:19: error: 'GLintptr' has a previous 
declaration as 'typedef ptrdiff_t GLintptr'
/usr/include/GLES2/gl2.h:39:26: error: conflicting declaration 'typedef 
khronos_ssize_t GLsizeiptr'
/usr/include/GL/glext.h:5073:19: error: 'GLsizeiptr' has a previous 
declaration as 'typedef ptrdiff_t GLsizeiptr'

The cause appears to be cogl being built against GLES2 on arm* while 
it's built against the regular GL
on everything else. Am I correct in thinking this is done to better 
support embeeded GPUs?

Would the correct course of action be to try and patch toonloop to also 
use GLES2 on armel and armhf?
if so i'll file a bug report against it (and maybe attempt to write a 
patch). Otherwise please tell me where
to file the bug report.




More information about the pkg-gnome-maintainers mailing list