From: Keir Fraser <keir@xen.org>
To: Christoph Egger <Christoph.Egger@amd.com>,
Tim Deegan <Tim.Deegan@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] xen: Deal with stdarg.h and -nostdinc
Date: Fri, 27 May 2011 14:13:34 +0100 [thread overview]
Message-ID: <CA05620F.2DB3F%keir@xen.org> (raw)
In-Reply-To: <4DDF735F.9020706@amd.com>
[-- Attachment #1: Type: text/plain, Size: 809 bytes --]
On 27/05/2011 10:48, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
>> Finally, rather than referencing a hardcoded /usr/include path or including
>> gcc intrinsics in xen/stdarg.h, would *BSD prefer a -isystem command-line
>> option to include the gcc headers in the search path? Then we could perhaps
>> even get rid of xen/stdarg.h completely.
>
> NetBSD is about to add clang/llvm support. If -isystem works for both
> gcc and clang then this should be fine.
Something like the attached patch? I don't know whether this would work for
clang too -- cc'ing Tim who will know or can try it out.
I wouldn't backport this one to 4.1, but my first patch was a cleanup plus
BSD-specific changes, so a variant on that would be suitable for 4.0/4.1,
with (if it works) this new one in unstable.
-- Keir
[-- Attachment #2: 01-stdarg-fixes --]
[-- Type: application/octet-stream, Size: 1985 bytes --]
diff -r fc963f9f2808 xen/arch/x86/Rules.mk
--- a/xen/arch/x86/Rules.mk Fri May 27 08:56:47 2011 +0100
+++ b/xen/arch/x86/Rules.mk Fri May 27 14:08:55 2011 +0100
@@ -11,11 +11,8 @@ xenoprof := y
#
supervisor_mode_kernel ?= n
-# Solaris grabs stdarg.h and friends from the system include directory.
-# Clang likewise.
-ifneq ($(XEN_OS),SunOS)
-CFLAGS-$(gcc) += -nostdinc
-endif
+SYS_INCDIR := $(shell $(CC) -print-file-name=include)
+CFLAGS += -nostdinc -isystem $(SYS_INCDIR)
CFLAGS += -fno-builtin -fno-common -Wredundant-decls
CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
diff -r fc963f9f2808 xen/common/libelf/libelf-loader.c
--- a/xen/common/libelf/libelf-loader.c Fri May 27 08:56:47 2011 +0100
+++ b/xen/common/libelf/libelf-loader.c Fri May 27 14:08:55 2011 +0100
@@ -16,8 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdarg.h>
-
#include "libelf-private.h"
/* ------------------------------------------------------------------------ */
diff -r fc963f9f2808 xen/common/libelf/libelf-private.h
--- a/xen/common/libelf/libelf-private.h Fri May 27 08:56:47 2011 +0100
+++ b/xen/common/libelf/libelf-private.h Fri May 27 14:08:55 2011 +0100
@@ -40,6 +40,7 @@
#else /* !__XEN__ */
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff -r fc963f9f2808 xen/common/vsprintf.c
--- a/xen/common/vsprintf.c Fri May 27 08:56:47 2011 +0100
+++ b/xen/common/vsprintf.c Fri May 27 14:08:55 2011 +0100
@@ -16,7 +16,6 @@
* - scnprintf and vscnprintf
*/
-#include <xen/stdarg.h>
#include <xen/ctype.h>
#include <xen/lib.h>
#include <asm/div64.h>
diff -r fc963f9f2808 xen/include/xen/stdarg.h
--- a/xen/include/xen/stdarg.h Fri May 27 08:56:47 2011 +0100
+++ b/xen/include/xen/stdarg.h Fri May 27 14:08:55 2011 +0100
@@ -1,5 +1,1 @@
-#if defined(__OpenBSD__)
-# include "/usr/include/stdarg.h"
-#else
-# include <stdarg.h>
-#endif
+#include <stdarg.h>
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2011-05-27 13:13 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CA052B9C.2DB31%keir@xen.org>
2011-05-27 9:48 ` [PATCH] xen: Deal with stdarg.h and -nostdinc Christoph Egger
2011-05-27 13:13 ` Keir Fraser [this message]
2011-05-27 14:05 ` Christoph Egger
2011-05-27 14:41 ` Keir Fraser
2011-05-27 14:51 ` Keir Fraser
2011-05-27 15:08 ` Christoph Egger
2011-05-27 13:16 ` Tim Deegan
2011-05-27 13:19 ` Keir Fraser
2011-05-27 13:27 ` Tim Deegan
2011-05-27 13:30 ` Ian Campbell
2011-05-26 14:54 Christoph Egger
2011-05-26 15:00 ` Christoph Egger
2011-05-26 15:17 ` Keir Fraser
2011-05-26 15:19 ` Jan Beulich
2011-05-26 16:11 ` Ian Jackson
2011-05-26 17:08 ` Keir Fraser
2011-05-27 7:55 ` Christoph Egger
2011-05-27 8:46 ` Keir Fraser
2011-05-27 8:59 ` Christoph Egger
2011-05-27 10:57 ` Ian Jackson
2011-05-27 7:47 ` Christoph Egger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA05620F.2DB3F%keir@xen.org \
--to=keir@xen.org \
--cc=Christoph.Egger@amd.com \
--cc=Tim.Deegan@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.