[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/6] xen/build: Allow the use of C freestanding headers



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.cooper3@xxxxxxxxxx>
---
CC: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
CC: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Tim Deegan <tim@xxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 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@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.