| Summary: | libX11-1.5.99.901 has changed prototype of _XData32, SDL-1.2 does not build | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Petr Pisar <ppisar> |
| Component: | build | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P5 | CC: | azamat.hackimov, bugreport, etc0de, mva, realnc, sezeroz, vincent.riera |
| Version: | 1.2.15 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
Proposed fix
libsdl-1.2-fix-compilation-libX11.patch libsdl2-fix-compilation-libX11.patch |
||
Created attachment 1078 [details]
Proposed fix
Bug is still there in SDL 2.0.0 RC1. Ryan, can you fix this for SDL 2.0 release? Thanks! I filed #1875 for SDL 2 *** Bug 1875 has been marked as a duplicate of this bug. *** Proposed patch is not backward compatible with libX11 < 1.5.99.901. Created attachment 1166 [details]
libsdl-1.2-fix-compilation-libX11.patch
This patch for SDL 1.2 is backward compatible with old libX11 version. Please test it.
Created attachment 1167 [details]
libsdl2-fix-compilation-libX11.patch
Patch for SDL2, cmake and autotools.
Fix looks good, thanks! :) Will you apply patch for SDL 1.2? (In reply to comment #10) > Will you apply patch for SDL 1.2? Badly needed for any platform with a recent xorg :-). Yep, added 1.2 patch, thanks! http://hg.libsdl.org/SDL/rev/91ad7b43317a (In reply to Sam Lantinga from comment #12) > Yep, added 1.2 patch, thanks! > http://hg.libsdl.org/SDL/rev/91ad7b43317a In that patch you are modifying configure.in to define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32, so autoreconf should be ran to make those changes take effect. The problem is that autoreconf fails: https://bugzilla.libsdl.org/show_bug.cgi?id=2340 (In reply to Vicente Olivert Riera from comment #13) > (In reply to Sam Lantinga from comment #12) > > Yep, added 1.2 patch, thanks! > > http://hg.libsdl.org/SDL/rev/91ad7b43317a > > In that patch you are modifying configure.in to define > SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32, so autoreconf should be ran to > make those changes take effect. The problem is that autoreconf fails: > https://bugzilla.libsdl.org/show_bug.cgi?id=2340 Your problem not directly related to this bug, I added comment to your bug. There is a regression in v1.2.15, xdata32 patch disappeared: arch: x86_64 uname -r: 4.5.2-1 libX11-6: 1.6.3-2.14 -------------------- wget -O - http://www.libsdl.org/release/SDL-1.2.15.tar.gz | gunzip | tar -xf - cd SDL-1.2.15 grep -i xdata32 configure.in || echo 'No such!' No such! --------- /bin/sh ./libtool --mode=compile gcc -g -O2 -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -D_REENTRANT -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -c ./src/video/x11/SDL_x11dyn.c -o build/SDL_x11dyn.lo libtool: compile: gcc -g -O2 -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -D_REENTRANT -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -c ./src/video/x11/SDL_x11dyn.c -fPIC -DPIC -o build/.libs/SDL_x11dyn.o ./src/video/x11/SDL_x11sym.h:168:17: error: conflicting types for '_XData32' SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return) ^ ./src/video/x11/SDL_x11dyn.c:95:5: note: in definition of macro 'SDL_X11_SYM' rc fn params { ret p##fn args ; } ^ In file included from ./src/video/x11/SDL_x11dyn.h:34:0, from ./src/video/x11/SDL_x11dyn.c:26: /usr/include/X11/Xlibint.h:681:12: note: previous declaration of '_XData32' was here extern int _XData32( ^ build-deps:1178: recipe for target 'build/SDL_x11dyn.lo' failed make: *** [build/SDL_x11dyn.lo] Error 1 This patch intended to appear in 1.2.16, not in 1.2.15. If you have problems with 1.2.15, you need apply patch manually. Closing this: the fix is already in SDL-1.2 branch. |
When building libsdl-1.2.15 against libX11-1.5.99.901 on x86_64, I get error on mismatching _XData32 declaration: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -D_REENTRANT -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -c ./src/video/x11/SDL_x11dyn.c -fPIC -DPIC -o build/.libs/SDL_x11dyn.o ./src/video/x11/SDL_x11sym.h:168:17: error: conflicting types for '_XData32' SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return) ^ ./src/video/x11/SDL_x11dyn.c:95:5: note: in definition of macro 'SDL_X11_SYM' rc fn params { ret p##fn args ; } ^ In file included from ./src/video/x11/SDL_x11dyn.h:34:0, from ./src/video/x11/SDL_x11dyn.c:26: /usr/include/X11/Xlibint.h:595:12: note: previous declaration of '_XData32' was here extern int _XData32( ^ make: *** [build/SDL_x11dyn.lo] Error 1 This is due to changes in libX11 coming with commit: commit f0b171c8ea7b055ba520272ea9a2604e18841ac7 Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Fri Feb 15 23:34:40 2013 -0800 Preserve constness in casting arguments through the Data*() routines Casts were annoying gcc by dropping constness when changing types, when routines simply either copy data into the request buffer or send it directly to the X server, and never modify the input. Fixes gcc warnings including: ChProp.c: In function 'XChangeProperty': ChProp.c:65:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] ChProp.c:65:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] ChProp.c:74:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] ChProp.c:74:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] ChProp.c:83:6: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] SetHints.c: In function 'XSetStandardProperties': SetHints.c:262:20: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] SetPntMap.c: In function 'XSetPointerMapping': SetPntMap.c:46:5: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] SetPntMap.c:46:5: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] StBytes.c: In function 'XStoreBuffer': StBytes.c:97:33: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] StName.c: In function 'XStoreName': StName.c:40:27: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] StName.c: In function 'XSetIconName': StName.c:51:27: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Relevant change in <X11/Xlibint.h> is: extern int _XData32( Display *dpy, - register long *data, + register _Xconst long *data, unsigned len ); Reading SDL 1.2 and 2 hg repositories, I believe both of them are affected.