Message ID | 20190726133331.91482-2-roger.pau@citrix.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | build: honor toolchain related environment vars | expand |
On 26.07.2019 15:33, Roger Pau Monne wrote: > Include config/$(OS).mk which contains the default values for the > toolchain variables. This removes the need to pass HOST{CC/CXX} as > parameters from the high level make target or to default them to > gcc/g++ if unset. From this description I thought reviewing would be straightforward. However, ... > --- a/xen/tools/kconfig/Makefile.kconfig > +++ b/xen/tools/kconfig/Makefile.kconfig > @@ -35,15 +35,14 @@ KBUILD_DEFCONFIG := $(ARCH)_defconfig > # provide our shell > CONFIG_SHELL := $(SHELL) > > -# provide the host compiler > -HOSTCC ?= gcc > -HOSTCXX ?= g++ > - > # force target > PHONY += FORCE > > FORCE: > > +# Sets toolchain binaries to use > +include $(XEN_ROOT)/config/$(shell uname -s).mk > + > # include the original Makefile and Makefile.host from Linux > include $(src)/Makefile > include $(src)/Makefile.host ... neither the make file here nor the two ones included (in context above) include any other file (afaics) that would lead to HOSTCC being defined. And nothing under $(XEN_ROOT)/config/ looks to define it either. I guess I'm missing something, as I'm sure this is working for you. Jan
On Mon, Jul 29, 2019 at 03:31:31PM +0000, Jan Beulich wrote: > On 26.07.2019 15:33, Roger Pau Monne wrote: > > Include config/$(OS).mk which contains the default values for the > > toolchain variables. This removes the need to pass HOST{CC/CXX} as > > parameters from the high level make target or to default them to > > gcc/g++ if unset. > > From this description I thought reviewing would be straightforward. > However, ... > > > --- a/xen/tools/kconfig/Makefile.kconfig > > +++ b/xen/tools/kconfig/Makefile.kconfig > > @@ -35,15 +35,14 @@ KBUILD_DEFCONFIG := $(ARCH)_defconfig > > # provide our shell > > CONFIG_SHELL := $(SHELL) > > > > -# provide the host compiler > > -HOSTCC ?= gcc > > -HOSTCXX ?= g++ > > - > > # force target > > PHONY += FORCE > > > > FORCE: > > > > +# Sets toolchain binaries to use > > +include $(XEN_ROOT)/config/$(shell uname -s).mk > > + > > # include the original Makefile and Makefile.host from Linux > > include $(src)/Makefile > > include $(src)/Makefile.host > > ... neither the make file here nor the two ones included (in > context above) include any other file (afaics) that would lead to > HOSTCC being defined. And nothing under $(XEN_ROOT)/config/ looks > to define it either. I guess I'm missing something, as I'm sure > this is working for you. Oh, that's my fault. There's a pre-patch missing in this series. The series should have been 4 patches, not 3. Given the comments to the other patches I will hold off sending a new version until we get consensus. Thanks, Roger.
diff --git a/xen/Makefile b/xen/Makefile index c80914c31d..e9f700f9e7 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -267,14 +267,14 @@ kconfig := silentoldconfig oldconfig config menuconfig defconfig \ randconfig $(notdir $(wildcard arch/$(SRCARCH)/configs/*_defconfig)) .PHONY: $(kconfig) $(kconfig): - $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) HOSTCC="$(HOSTCC)" HOSTCXX="$(HOSTCXX)" $@ + $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) $@ include/config/%.conf: include/config/auto.conf.cmd $(KCONFIG_CONFIG) - $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) HOSTCC="$(HOSTCC)" HOSTCXX="$(HOSTCXX)" silentoldconfig + $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) silentoldconfig # Allow people to just run `make` as before and not force them to configure $(KCONFIG_CONFIG): - $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) HOSTCC="$(HOSTCC)" HOSTCXX="$(HOSTCXX)" defconfig + $(MAKE) -f $(BASEDIR)/tools/kconfig/Makefile.kconfig ARCH=$(ARCH) SRCARCH=$(SRCARCH) defconfig # Break the dependency chain for the first run include/config/auto.conf.cmd: ; diff --git a/xen/tools/kconfig/Makefile.kconfig b/xen/tools/kconfig/Makefile.kconfig index dbd8912015..138bf3f1b7 100644 --- a/xen/tools/kconfig/Makefile.kconfig +++ b/xen/tools/kconfig/Makefile.kconfig @@ -35,15 +35,14 @@ KBUILD_DEFCONFIG := $(ARCH)_defconfig # provide our shell CONFIG_SHELL := $(SHELL) -# provide the host compiler -HOSTCC ?= gcc -HOSTCXX ?= g++ - # force target PHONY += FORCE FORCE: +# Sets toolchain binaries to use +include $(XEN_ROOT)/config/$(shell uname -s).mk + # include the original Makefile and Makefile.host from Linux include $(src)/Makefile include $(src)/Makefile.host
Include config/$(OS).mk which contains the default values for the toolchain variables. This removes the need to pass HOST{CC/CXX} as parameters from the high level make target or to default them to gcc/g++ if unset. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> --- Cc: Andrew Cooper <andrew.cooper3@citrix.com> Cc: George Dunlap <George.Dunlap@eu.citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Jan Beulich <jbeulich@suse.com> Cc: Julien Grall <julien.grall@arm.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Stefano Stabellini <sstabellini@kernel.org> Cc: Tim Deegan <tim@xen.org> Cc: Wei Liu <wl@xen.org> Cc: Doug Goldstein <cardoe@cardoe.com> --- xen/Makefile | 6 +++--- xen/tools/kconfig/Makefile.kconfig | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-)