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] [PATCH 8 of 8] xen: add "clang=y" option to build Xen wi

To: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 8 of 8] xen: add "clang=y" option to build Xen with clang/llvm instead of gcc
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Mon, 7 Mar 2011 14:54:29 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 07 Mar 2011 06:55:27 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <d91e6a8d36ad3dbf89f4.1299497185@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <patchbomb.1299497177@xxxxxxxxxxxxxxxxxxxxxxx> <d91e6a8d36ad3dbf89f4.1299497185@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Mon, 2011-03-07 at 11:26 +0000, Tim Deegan wrote:
> # HG changeset patch
> # User Tim Deegan <Tim.Deegan@xxxxxxxxxx>
> # Date 1299496871 0
> # Node ID d91e6a8d36ad3dbf89f42264334baec0cb37063f
> # Parent  804007170cf03ea832022e2d589507a3bc0505dc
> 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@xxxxxxxxxx>
> 
> diff -r 804007170cf0 -r d91e6a8d36ad Config.mk
> --- a/Config.mk Mon Mar 07 11:21:11 2011 +0000
> +++ b/Config.mk Mon Mar 07 11:21:11 2011 +0000
> @@ -148,6 +148,13 @@ CFLAGS += -Wall -Wstrict-prototypes
>  # result of any casted expression causes a warning.
>  CFLAGS += -Wno-unused-value
>  
> +ifeq ($(clang),y)
> +# Clang complains about macros that expand to 'if ( ( foo == bar )
> ) ...'
> +CFLAGS += -Wno-parentheses
> +# And is over-zealous with the printf format lint
> +CFLAGS += -Wno-format
> +endif

Is it worth arranging for "gcc := y" when clang is not enabled? Then a
whole bunch of this sort of thing devolves into the 
        CFLAGS-$(a-particular-cc) += -Wfoo
pattern.

> +
>  $(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement)
>  $(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
>  
> diff -r 804007170cf0 -r d91e6a8d36ad config/StdGNU.mk
> --- a/config/StdGNU.mk  Mon Mar 07 11:21:11 2011 +0000
> +++ b/config/StdGNU.mk  Mon Mar 07 11:21:11 2011 +0000
> @@ -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

LD-$(clang) = ...
LD-$(gcc)   = ...

LD := $(LD-y)

?

> @@ -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

CFLAGS-$(gcc) += ...

etc etc

Ian.



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

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