Summary: | git version of xserver fails to compile with -O2 and #define _GNU_SOURCE 1 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | Sérgio M. Basto <sergio> | ||||||
Component: | Server/General | Assignee: | Xorg Project Team <xorg-team> | ||||||
Status: | RESOLVED NOTOURBUG | QA Contact: | Xorg Project Team <xorg-team> | ||||||
Severity: | normal | ||||||||
Priority: | medium | CC: | sergio | ||||||
Version: | git | ||||||||
Hardware: | Other | ||||||||
OS: | Linux (All) | ||||||||
Whiteboard: | 2012BRB_Reviewed | ||||||||
i915 platform: | i915 features: | ||||||||
Attachments: |
|
Description
Sérgio M. Basto
2012-03-27 17:51:12 UTC
gcc say is source fault . strndup is a macro in glibc header files. Use (strndup) to disable the macro function. This is not a GCC bug or a glibc bug (since you supply _GNU_SOURCE which says define this macro) as the header is using something in the GNU_SOURCE namespace. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52785#c4 I don't see what this has to do with building the X server - all the snippets here are headers out of context. When building the X server, the configure script detects if your platform has strndup and defines HAVE_STRNDUP in dix-config.h & xorg-config.h, which xf86.h includes when used inside the X server builds. What are you really doing when you see this error? (In reply to comment #2) > What are you really doing when you see this error? I am trying compile VirtualBox-OSE-4.1.10 for Fedora 17, rpmfusion.org packages but I reduce the problem to teste.c #define _GNU_SOURCE 1 #include <xf86.h> > When building the X server, the configure script detects if your platform has > strndup and defines HAVE_STRNDUP in dix-config.h & xorg-config.h, which xf86.h > includes when used inside the X server builds. I also add #define HAVE_STRNDUP 1 to source and finally could compile the VirtualBox. ./configure add defines, seems to me that is not the best way, but I don't know, I have to think and I'm not an expert. Thanks, (In reply to comment #2) > I don't see what this has to do with building the X server - all the snippets > here are headers out of context. > > When building the X server, the configure script detects if your platform has > strndup and defines HAVE_STRNDUP in dix-config.h & xorg-config.h, which xf86.h > includes when used inside the X server builds. > > What are you really doing when you see this error? since all problem is not define HAVE_STRNDUP are you saying ? that /usr/share/xorg-x11-server-source/include/xorg-config.h and /usr/share/xorg-x11-server-source/include/dix-config.h should define HAVE_STRNDUP ? I want compile X11 parts of VirtualBox with Fedora X11 server sources. I have no idea what you put in /usr/share/xorg-x11-server-source, but if you download the sources X.Org provides for the X server and run the configure script, it should put #define HAVE_STRNDUP 1 in include/dix-config.h and include/xorg-server.h if your platform supports strndup(). (In reply to comment #5) > I have no idea what you put in /usr/share/xorg-x11-server-source, rpm -qf /usr/share/xorg-x11-server-source xorg-x11-server-source-1.11.4-2.fc16.noarch Neither do I, I use xorg-x11-server-source provide by Fedora 17 > but if you > download the sources X.Org provides for the X server and run the configure > script, it should put > > #define HAVE_STRNDUP 1 > > in include/dix-config.h and include/xorg-server.h if your platform supports > strndup(). seems don't have it Created attachment 95897 [details]
fail without #define HAVE_STRNDUP 1
For Compile VirtualBox-4.3.8 for Fedora 21 . I still need define HAVE_STRNDUP
#define HAVE_STRNDUP 1
I manage to drop Buildrequires of xorg-x11-server-source-1.15.0-5.fc21
Now we just need :
BuildRequires: libdrm-devel
BuildRequires: libpciaccess-devel
BuildRequires: mesa-libGL-devel
BuildRequires: mesa-libOSMesa-devel
BuildRequires: pixman-devel
BuildRequires: xorg-x11-proto-devel
BuildRequires: xorg-x11-server-devel
BuildRequires: libXcursor-devel
BuildRequires: libXcomposite-devel
BuildRequires: libXmu-devel
Please ask for more info and what information that you need ?
Created attachment 95900 [details]
better look of fail without #define HAVE_STRNDUP 1
Hi , I think that find what I'm missing is include : #include "/usr/share/xorg-x11-server-source/include/xorg-server.h" to compile X11 drv for guest system (vm) of Fedora on VirtualBox so this can bug report can be closed ? |
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.