We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4797

Summary: SDL "default" fails to compile with Mesa Master.
Product: SDL Reporter: bluescreen_avenger
Component: mainAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2 CC: m.olbrich, sylvain.becker
Version: HG 2.1Keywords: target-2.0.12
Hardware: x86   
OS: Linux   
Attachments: Patch to fix the problem

Description bluescreen_avenger 2019-09-09 20:55:54 UTC
I think something in their headers changed in June. Compiling against a Mesa master I get

  CC     build/SDL_video.lo
In file included from include/SDL_opengles.h:33:0,
                 from /srcbuild/SDL/src/video/SDL_video.c:41:
/opt/include/GLES/gl.h:63:25: error: conflicting types for 'GLsizeiptr'
 typedef khronos_ssize_t GLsizeiptr;
                         ^~~~~~~~~~
In file included from include/SDL_opengl.h:2105:0,
                 from /srcbuild/SDL/src/video/SDL_video.c:37:
include/SDL_opengl_glext.h:472:19: note: previous declaration of 'GLsizeiptr' was here
 typedef ptrdiff_t GLsizeiptr;
                   ^~~~~~~~~~
In file included from include/SDL_opengles.h:33:0,
                 from /srcbuild/SDL/src/video/SDL_video.c:41:
/opt/include/GLES/gl.h:64:26: error: conflicting types for 'GLintptr'
 typedef khronos_intptr_t GLintptr;
                          ^~~~~~~~
In file included from include/SDL_opengl.h:2105:0,
                 from /srcbuild/SDL/src/video/SDL_video.c:37:
include/SDL_opengl_glext.h:473:19: note: previous declaration of 'GLintptr' was here
 typedef ptrdiff_t GLintptr;
                   ^~~~~~~~
  CC     build/SDL_vulkan_utils.lo
make: *** [Makefile:552: build/SDL_video.lo] Error 1
make: *** Waiting for unfinished jobs....
nerdopolis@nerdopolis:~$ 


Thanks
Comment 1 bluescreen_avenger 2019-09-11 02:48:15 UTC
build args:
./configure --prefix=$INSTALLDIR --libdir=$INSTALLDIR/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) --enable-wayland-shared=no


config.status: executing summary commands
SDL2 Configure Summary:
Building Shared Libraries
Building Static Libraries
Enabled modules : atomic audio video render events joystick haptic sensor power filesystem threads timers file loadso cpuinfo assembly
Assembly Math   : mmx 3dnow sse
Audio drivers   : disk dummy oss alsa(dynamic) pulse(dynamic)
Video drivers   : dummy x11(dynamic) opengl opengl_es1 opengl_es2 vulkan wayland
X11 libraries   : xcursor xdbe xinerama xinput2 xinput2_multitouch xrandr xscrnsaver xshape xvidmode
Input drivers   : linuxev linuxkd
Using libsamplerate : NO
Using libudev       : YES
Using dbus          : YES
Using ime           : YES
Using ibus          : YES
Using fcitx         : NO
PackagePrepareBuild finished in 9 seconds
Comment 2 bluescreen_avenger 2019-09-20 02:44:35 UTC
I also forgot to add, this is 32 bit
Comment 3 Ryan C. Gordon 2019-09-20 20:47:37 UTC
We're changing how we do SDL release versions; now releases will be even numbers (2.0.10, 2.0.12, etc), and as soon as we tag a release, we'll move the internal version number to an odd number (2.0.12 ships, we tag the latest in revision control as 2.0.13 immediately, which will become 2.0.14 on release, etc).

As such, I'm moving the bugs tagged with target-2.0.11 to target 2.0.12. Sorry if you get a lot of email from this change!

Thanks,
--ryan.
Comment 4 Ryan C. Gordon 2019-09-20 20:48:40 UTC
We're changing how we do SDL release versions; now releases will be even numbers (2.0.10, 2.0.12, etc), and as soon as we tag a release, we'll move the internal version number to an odd number (2.0.12 ships, we tag the latest in revision control as 2.0.13 immediately, which will become 2.0.14 on release, etc).

As such, I'm moving the bugs tagged with target-2.0.11 to target 2.0.12. Sorry if you get a lot of email from this change!

Thanks,
--ryan.
Comment 5 Michael Olbrich 2019-10-10 16:37:58 UTC
Created attachment 3981 [details]
Patch to fix the problem

This should fix the build error. The same thing happend with ES2 years ago. It just accidentally worked for ES1 until Mesa changed the header guard.
Comment 6 bluescreen_avenger 2019-10-11 03:53:27 UTC
I forgot to update the thread a while back. I actually guessed, and gave something very similar a try and it worked, but I assumed I only cobbled up a workaround, instead of an actual fix. I guess it's good to merge
Comment 7 Sylvain 2019-10-12 16:50:28 UTC
Thanks! fixed in https://hg.libsdl.org/SDL/rev/369b01006eb2

For Open GLES 2, that was fixed in https://hg.libsdl.org/SDL/rev/a60b3c292f0f