From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH 8 of 8] xen: add "clang=y" option to build Xen with clang/llvm instead of gcc Date: Mon, 07 Mar 2011 17:01:58 +0000 Message-ID: References: <20110307162934.GD28479@whitby.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20110307162934.GD28479@whitby.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tim Deegan , Ian Campbell Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 07/03/2011 16:29, "Tim Deegan" wrote: > At 14:54 +0000 on 07 Mar (1299509669), Ian Campbell wrote: >> 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. > > Something like the attached? It tidies up four such ifeqs, at the cost > of one new one to define $(gcc). > (4 files changed, 17 insertions(+), 16 deletions(-)) This looks like a definite improvement in readability, to me. I'd like it to be applied. -- Keir >>> @@ -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) > > I tried that but it looks about as bad, and actually has more > repetition. > > Tim.