aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorTim Deegan <Tim.Deegan@citrix.com>2011-03-07 11:21:11 +0000
committerTim Deegan <Tim.Deegan@citrix.com>2011-03-07 11:21:11 +0000
commit436323c065f0ace4f469f5854f43423702a5082a (patch)
treea93c7f16cc6371a524eedcd7c642848f0d244f66 /config
parentcde9655eddba4d6636249863e41b2bb5103ba2ee (diff)
downloadxen-436323c065f0ace4f469f5854f43423702a5082a.tar.gz
xen-436323c065f0ace4f469f5854f43423702a5082a.tar.bz2
xen-436323c065f0ace4f469f5854f43423702a5082a.zip
xen: add "clang=y" option to build Xen with clang/llvm instead of gcc.
Tested with svn snapshot of clang and llvm from 17 February 2011. Only x86_64 hypervisor builds (make dist-xen clang=y) are supported and I haven't even begun to look at cross-compiling. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'config')
-rw-r--r--config/StdGNU.mk10
1 files changed, 9 insertions, 1 deletions
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index f27bdc59f5..d73e644bbf 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -1,6 +1,11 @@
AS = $(CROSS_COMPILE)as
+ifeq ($(clang),y)
+LD = $(CROSS_COMPILE)gold
+CC = $(CROSS_COMPILE)clang
+else
LD = $(CROSS_COMPILE)ld
CC = $(CROSS_COMPILE)gcc
+endif
CPP = $(CC) -E
AR = $(CROSS_COMPILE)ar
RANLIB = $(CROSS_COMPILE)ranlib
@@ -69,5 +74,8 @@ ifneq ($(debug),y)
CFLAGS += -O2 -fomit-frame-pointer
else
# Less than -O1 produces bad code and large stack frames
-CFLAGS += -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls
+CFLAGS += -O1 -fno-omit-frame-pointer
+ifneq ($(clang),y)
+CFLAGS += -fno-optimize-sibling-calls
+endif
endif