Latest git version of xserver fails to compile showing the following error: --- Making all in dix make[1]: Entering directory `/home/jos/src/xorg/git-master/xserver/dix' make all-am make[2]: Entering directory `/home/jos/src/xorg/git-master/xserver/dix' CC atom.lo In file included from ../include/misc.h:109:0, from atom.c:57: ../include/os.h:496:25: error: expected identifier or '(' before '__extension__' In file included from atom.c:59:0: ../include/dix.h:532:22: warning: redundant redeclaration of 'ffs' [-Wredundant-decls] atom.c: In function 'MakeAtom': atom.c:134:12: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] atom.c: In function 'FreeAtom': atom.c:186:7: warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual] make[2]: *** [atom.lo] Error 1 make[2]: Leaving directory `/home/jos/src/xorg/git-master/xserver/dix' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/jos/src/xorg/git-master/xserver/dix' make: *** [all-recursive] Error 1 ---
Perhaps size_t is not defined... #ifndef HAVE_STRNDUP extern _X_EXPORT char * strndup(const char *str, size_t n); #endif Does adding this near the top of include/os.h fix your build failure: #include <stdlib.h>
(In reply to comment #1) > Does adding this near the top of include/os.h fix your build failure: > > #include <stdlib.h> Yes, it does fix the build failure. Thanks!
(In reply to comment #1) > Perhaps size_t is not defined... > #ifndef HAVE_STRNDUP > extern _X_EXPORT char * strndup(const char *str, size_t n); > #endif > > Does adding this near the top of include/os.h fix your build failure: > > #include <stdlib.h> Unfortunately patching /usr/include/xorg/os.h does introduce a build error in building git mesa: --- In file included from /usr/include/xorg/misc.h:109:0, from /usr/include/xorg/xf86str.h:37, from /usr/include/xorg/xf86.h:44, from xorg_tracker.h:41, from xorg_exa.h:4, from xorg_composite.h:4, from xorg_composite.c:1: /usr/include/xorg/os.h:498:25: error: expected identifier or ‘(’ before ‘__extension__’ In file included from /usr/include/xorg/randrstr.h:39:0, from /usr/include/xorg/xf86Crtc.h:27, from xorg_tracker.h:42, from xorg_exa.h:4, from xorg_composite.h:4, from xorg_composite.c:1: /usr/include/xorg/os.h:48:25: error: expected identifier or ‘(’ before ‘__extension__’ make[4]: *** [xorg_composite.o] Error 1 make[4]: Leaving directory `/home/jos/src/xorg/git-master/mesa/src/gallium/state_trackers/xorg' make[3]: *** [subdirs] Error 1 make[3]: Leaving directory `/home/jos/src/xorg/git-master/mesa/src/gallium/state_trackers' make[2]: *** [default] Error 1 make[2]: Leaving directory `/home/jos/src/xorg/git-master/mesa/src/gallium' make[1]: *** [subdirs] Error 1 ---
Fixed, no more build failures since latest git version!
(In reply to comment #4) > Fixed, no more build failures since latest git version! what is the fix ? I getting the same problem in fedora rawhide
The "fix" is to grab the latest sources ... since the latest version builds, I don't want to spend time diving into exactly when your bug was fixed.
but still present in xorg-x11-server-1.12.0-1.fc17 . the fix is very simple since is add #include <stdlib.h> before call os.h just FYI.
I got this issue also in i386
Sorry for spamming , but I was wrong or something went in my tests , so my lasts comments couldn't be correct. I'm trying compile VirtualBox on Fedora rawhide . and I got: /usr/include/xorg/os.h:497:55: error: expected identifier or ‘(’ before ‘__extension__’ which is also related with #ifndef HAVE_STRNDUP extern _X_EXPORT char * strndup(const char *str, size_t n); #endif
(In reply to comment #9) > I'm trying compile VirtualBox on Fedora rawhide . That's not this bug - you're adding comments to an already fixed bug about the X server itself not building, and since it's marked resolved and on a different topic, none of the X developers will be doing anything more with it. Since you have a different problem compiling a different package, you should file a bug in the bug tracker for that package, which is probably on virtualbox.org.
(In reply to comment #1) > Perhaps size_t is not defined... > #ifndef HAVE_STRNDUP > extern _X_EXPORT char * strndup(const char *str, size_t n); > #endif > > Does adding this near the top of include/os.h fix your build failure: > > #include <stdlib.h> on bug #47971, my conclusion is, HAVE_STRNDUP should be defined
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.