The C standard defines two types of conforming implementation; hosted and
freestanding.  A subset of the standard headers are the freestanding headers,
requiring no library support at all to use, and therefore usable by Xen.

Unfortunately, -nostdinc is an overly large switch, and there is no
alternative to only permit inclusion of the freestanding headers.  Removing it
is unfortunate, as we lose the protection it offers, but anyone who does try
to use other parts of the standard library will still fail to link.

While altering this area, replace -fno-builtin with -ffreestanding, which
implies -fno-builtin, but also sets __STDC_HOSTED__ to 0.

Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
---
CC: George Dunlap <george.dun...@eu.citrix.com>
CC: Ian Jackson <ian.jack...@eu.citrix.com>
CC: Jan Beulich <jbeul...@suse.com>
CC: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
CC: Stefano Stabellini <sstabell...@kernel.org>
CC: Tim Deegan <t...@xen.org>
CC: Wei Liu <wei.l...@citrix.com>
---
 xen/Rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index ebe1dc0..e0b7ae6 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -46,7 +46,7 @@ ALL_OBJS-y               += $(BASEDIR)/xsm/built_in.o
 ALL_OBJS-y               += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
 ALL_OBJS-$(CONFIG_X86)   += $(BASEDIR)/crypto/built_in.o
 
-CFLAGS += -nostdinc -fno-builtin -fno-common
+CFLAGS += -ffreestanding -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
 CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to