From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Welche Subject: Re: stdbool.h -nostdinc XSA-55 trouble Date: Thu, 8 Aug 2013 16:39:09 +0100 Message-ID: <20130808153909.GC870@quark> References: <20130808114945.GG22372@quark> <5203B51402000078000EA534@nat28.tlf.novell.com> <20130808151835.GB870@quark> <1375975437.14651.7.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1375975437.14651.7.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, Aug 08, 2013 at 04:23:57PM +0100, Ian Campbell wrote: > On Thu, 2013-08-08 at 16:18 +0100, Patrick Welche wrote: > > On Thu, Aug 08, 2013 at 02:11:16PM +0100, Jan Beulich wrote: > > > >>> On 08.08.13 at 13:49, Patrick Welche wrote: > > > > I hope that this is the right list for compilation issues. > > > > > > > > When building libelf-tools.c with gcc 4.5.4 on NetBSD-current/amd64: > > > > > > > > In file included from libelf-private.h:25:0, > > > > from libelf-tools.c:19: > > > > /usr/src/local/xen/xen/include/xen/libelf.h:32:21: fatal error: stdbool.h: > > > > No such file or directory [...] > > > No mystery, but also not immediately obvious: -iwithprefix adds > > > the compiler's include directory to the end of the include search > > > paths, thus allowing stdbool.h and stdarg.h to be found. For > > > stdarg.h (which you ought to have the same problem with in > > > libelf/) xen/stdarg.h already has special treatment for > > > __OpenBSD__ and __NetBSD__ (i.e. avoiding similar problems > > > for all the cases where xen/stdarg.h is used instead of plain > > > stdarg.h). > > > > > > Whether that's not the case on NetBSD, or whether that directory > > > simply doesn't exist or is empty you'd need to find out on your > > > installation. > > > > So, in xen/arch/x86/Rules.mk, there is "-iwithprefix include", > > which means add "include" to the end of the directory defined > > by the "-iprefix DIR" option. I just looked on an ubuntu 10 box, > > and gcc -v lists "--prefix=/usr" which seems to be used as the > > default value of -iprefix. The gcc compiler on the NetBSD box > > doesn't list --prefix as one of its configure options, so > > I don't know what directory is used as the default prefix. ""? After Ian's comment below - that bit of "--prefix=/usr" theory is wrong as on the ubuntu box stdbool.h is indeed under /usr/lib/gcc... and the default prefix is where gcc "staging files" are kept. [...] > > (/usr/include/stdbool.h is what we are aiming for.) > > At least on Debian we are actually aiming > for /usr/lib/gcc/x86_64-linux-gnu/X.Y/include/stdbool.h > > I don't have /usr/include/stdbool.h. This makes sense since stdbool is, > AIUI, a compiler provided interface, not a libc one. > > Perhaps this is a difference between Linux and BSD? So it seems. According to stdbool(3) on the NetBSD box STANDARDS The header conforms to ISO/IEC 9899:1999 (``ISO C99'') and IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY The header was first introduced in NetBSD 1.6. and ominously The ability to undefine and redefine the macros bool, true, and false is an obsolescent feature that may be withdrawn in a future version of a standard. Does this have implications for the orginal XSA-55? Cheers, Patrick