WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] xen/stdarg.h patch

On Thu, Oct 19, 2006 at 02:41:49PM +0100, Keir Fraser wrote:

> > Only by adding "-I /usr/include/", and that doesn't seem ideal.
> 
> Perhaps acceptable if it works? We generally like to avoid it because it
> prevents us accidentally including system header files. If we need it just
> for Solaris it's not so bad though -- our main build environment (Linux)
> will continue to provide a safety net.

Fair point.

regards
john

# HG changeset patch
# User john.levon@xxxxxxx
# Date 1161272148 25200
# Node ID 73d8a4df0f0b0d5747f5937f5954a5302a9e2f74
# Parent  2e1a04af35cf4bc43dc6f0cde4539c5117fa500f
Disable -nostdinc on Solaris so we can use the system's <stdarg.h>.

Signed-off-by: John Levon <john.levon@xxxxxxx>

diff --git a/config/StdGNU.mk b/config/StdGNU.mk
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -21,6 +21,8 @@ SONAME_LDFLAG = -soname
 SONAME_LDFLAG = -soname
 SHLIB_CFLAGS = -shared
 
+STDINC_CFLAG = -nostdinc
+
 ifneq ($(debug),y)
 # Optimisation flags are overridable
 CFLAGS ?= -O2 -fomit-frame-pointer
diff --git a/config/SunOS.mk b/config/SunOS.mk
--- a/config/SunOS.mk
+++ b/config/SunOS.mk
@@ -33,4 +33,7 @@ endif
 
 CFLAGS += -Wa,--divide -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__
 
+# We can't use -nostdinc, as Xen needs <stdarg.h>
+STDINC_CFLAG =
+
 CONFIG_IOEMU_OS = n
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -11,7 +11,7 @@ pae ?= n
 pae ?= n
 supervisor_mode_kernel ?= n
 
-CFLAGS += -nostdinc -fno-builtin -fno-common -fno-strict-aliasing
+CFLAGS += $(STDINC_CFLAG) -fno-builtin -fno-common -fno-strict-aliasing
 CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
 CFLAGS += -I$(BASEDIR)/include 
 CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic
diff --git a/xen/include/xen/stdarg.h b/xen/include/xen/stdarg.h
--- a/xen/include/xen/stdarg.h
+++ b/xen/include/xen/stdarg.h
@@ -1,4 +1,4 @@
-#if defined(__OpenBSD__) || defined(__sun__)
+#if defined(__OpenBSD__)
 #  include "/usr/include/stdarg.h"
 #else
 #  include <stdarg.h>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>