Re: [Xen-devel] [PATCH for-4.7 1/5] build: make HOSTCC conditional on the value of clang

2016-04-20 Thread Jan Beulich
>>> Roger Pau Monné  04/20/16 4:51 PM >>>
>On Sun, Apr 17, 2016 at 02:03:28PM -0600, Jan Beulich wrote:
>> >>> Roger Pau Monne  04/15/16 8:27 PM >>>
>> >@@ -50,8 +49,10 @@ DESTDIR ?= /
>>  >clang ?= n
>>  >ifeq ($(clang),n)
>>  >gcc := y
>> >+HOSTCC = gcc
>>  >else
>>  >gcc := n
>> >+HOSTCC = clang
>>  >endif
>>  
>>  In particular I wonder what this means for cross builds, where someone may
>> have installed e.g. only a cross variant of clang.
>
>Right, I think this should be ?= instead of =, so if a user has HOSTCC set 
>in the build environment the build system doesn't overwrite it.
 >
>> That said, I'm not really opposed to the change (as it seems to be at least 
>> an
>> incremental improvement), I only wonder whether some more thought (and
>> change) is needed here.
>
>IMHO, I think using ?= should at least be more correct, or if anyone has a 
>better suggestion I'm happy to implement it.

Yes, that would at least eliminate some of my (admittedly vague) concerns.

Jan


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


Re: [Xen-devel] [PATCH for-4.7 1/5] build: make HOSTCC conditional on the value of clang

2016-04-20 Thread Roger Pau Monné
On Sun, Apr 17, 2016 at 02:03:28PM -0600, Jan Beulich wrote:
> >>> Roger Pau Monne  04/15/16 8:27 PM >>>
> >Previously HOSTCC was always hardcoded to gcc
> 
> So what is the goal here? Be able to build on a gcc-free system? Or else, how
> does it matter what compiler build elements get built with?

Exactly. Newish FreeBSD versions (>=10 IIRC) only have clang in the base 
system.
 
> >--- a/Config.mk
> >+++ b/Config.mk
> >@@ -36,7 +36,6 @@ CONFIG_$(XEN_OS) := y
>  >SHELL ?= /bin/sh
>  >
>  ># Tools to run on system hosting the build
> >-HOSTCC  = gcc
>  >HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
>  >HOSTCFLAGS += -fno-strict-aliasing
>  >
> >@@ -50,8 +49,10 @@ DESTDIR ?= /
>  >clang ?= n
>  >ifeq ($(clang),n)
>  >gcc := y
> >+HOSTCC = gcc
>  >else
>  >gcc := n
> >+HOSTCC = clang
>  >endif
>  
>  In particular I wonder what this means for cross builds, where someone may
> have installed e.g. only a cross variant of clang.

Right, I think this should be ?= instead of =, so if a user has HOSTCC set 
in the build environment the build system doesn't overwrite it.
 
> That said, I'm not really opposed to the change (as it seems to be at least an
> incremental improvement), I only wonder whether some more thought (and
> change) is needed here.

IMHO, I think using ?= should at least be more correct, or if anyone has a 
better suggestion I'm happy to implement it.

Roger.

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


Re: [Xen-devel] [PATCH for-4.7 1/5] build: make HOSTCC conditional on the value of clang

2016-04-17 Thread Jan Beulich
>>> Roger Pau Monne  04/15/16 8:27 PM >>>
>Previously HOSTCC was always hardcoded to gcc

So what is the goal here? Be able to build on a gcc-free system? Or else, how
does it matter what compiler build elements get built with?

>--- a/Config.mk
>+++ b/Config.mk
>@@ -36,7 +36,6 @@ CONFIG_$(XEN_OS) := y
 >SHELL ?= /bin/sh
 >
 ># Tools to run on system hosting the build
>-HOSTCC  = gcc
 >HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
 >HOSTCFLAGS += -fno-strict-aliasing
 >
>@@ -50,8 +49,10 @@ DESTDIR ?= /
 >clang ?= n
 >ifeq ($(clang),n)
 >gcc := y
>+HOSTCC = gcc
 >else
 >gcc := n
>+HOSTCC = clang
 >endif
 
 In particular I wonder what this means for cross builds, where someone may
have installed e.g. only a cross variant of clang.

That said, I'm not really opposed to the change (as it seems to be at least an
incremental improvement), I only wonder whether some more thought (and
change) is needed here.

Jan


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


[Xen-devel] [PATCH for-4.7 1/5] build: make HOSTCC conditional on the value of clang

2016-04-15 Thread Roger Pau Monne
Previously HOSTCC was always hardcoded to gcc

Signed-off-by: Roger Pau Monné 
---
Cc: Ian Jackson 
Cc: Jan Beulich 
Cc: Keir Fraser 
Cc: Tim Deegan 
---
 Config.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index bfab893..deaa768 100644
--- a/Config.mk
+++ b/Config.mk
@@ -36,7 +36,6 @@ CONFIG_$(XEN_OS) := y
 SHELL ?= /bin/sh
 
 # Tools to run on system hosting the build
-HOSTCC  = gcc
 HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
 HOSTCFLAGS += -fno-strict-aliasing
 
@@ -50,8 +49,10 @@ DESTDIR ?= /
 clang ?= n
 ifeq ($(clang),n)
 gcc := y
+HOSTCC = gcc
 else
 gcc := n
+HOSTCC = clang
 endif
 
 
-- 
2.6.4 (Apple Git-63)


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