[Xen-devel] [PATCH] config: don't hardcode toolchain binaries

Roger Pau Monne posted 1 patch 16 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20190625133944.36588-1-roger.pau@citrix.com
config/StdGNU.mk | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)

[Xen-devel] [PATCH] config: don't hardcode toolchain binaries

Posted by Roger Pau Monne 16 weeks ago
Currently the names of the build toolchain binaries are hardcoded in
StdGNU.mk, and the values from the environment are ignored.

Switch StdGNU.mk to use '?=' instead of '=', so that values from the
environment are used if present, else default to the values provided
by the config file.

This change fixes the gitlab CI loop, that was relying on passing
custom values in the environment variables for the compiler and the
linker.

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>
---
 config/StdGNU.mk | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index 039274ea61..c9624b043c 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -1,27 +1,27 @@
-AS         = $(CROSS_COMPILE)as
-LD         = $(CROSS_COMPILE)ld
+AS        ?= $(CROSS_COMPILE)as
+LD        ?= $(CROSS_COMPILE)ld
 ifeq ($(clang),y)
-CC         = $(CROSS_COMPILE)clang
-CXX        = $(CROSS_COMPILE)clang++
-LD_LTO     = $(CROSS_COMPILE)llvm-ld
+CC        ?= $(CROSS_COMPILE)clang
+CXX       ?= $(CROSS_COMPILE)clang++
+LD_LTO    ?= $(CROSS_COMPILE)llvm-ld
 else
-CC         = $(CROSS_COMPILE)gcc
-CXX        = $(CROSS_COMPILE)g++
-LD_LTO     = $(CROSS_COMPILE)ld
+CC        ?= $(CROSS_COMPILE)gcc
+CXX       ?= $(CROSS_COMPILE)g++
+LD_LTO    ?= $(CROSS_COMPILE)ld
 endif
-CPP        = $(CC) -E
-AR         = $(CROSS_COMPILE)ar
-RANLIB     = $(CROSS_COMPILE)ranlib
-NM         = $(CROSS_COMPILE)nm
-STRIP      = $(CROSS_COMPILE)strip
-OBJCOPY    = $(CROSS_COMPILE)objcopy
-OBJDUMP    = $(CROSS_COMPILE)objdump
-SIZEUTIL   = $(CROSS_COMPILE)size
+CPP       ?= $(CC) -E
+AR        ?= $(CROSS_COMPILE)ar
+RANLIB    ?= $(CROSS_COMPILE)ranlib
+NM        ?= $(CROSS_COMPILE)nm
+STRIP     ?= $(CROSS_COMPILE)strip
+OBJCOPY   ?= $(CROSS_COMPILE)objcopy
+OBJDUMP   ?= $(CROSS_COMPILE)objdump
+SIZEUTIL  ?= $(CROSS_COMPILE)size
 
 # Allow git to be wrappered in the environment
 GIT        ?= git
 
-INSTALL      = install
+INSTALL   ?= install
 INSTALL_DIR  = $(INSTALL) -d -m0755 -p
 INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
-- 
2.20.1 (Apple Git-117)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] config: don't hardcode toolchain binaries

Posted by Ian Jackson 16 weeks ago
Roger Pau Monne writes ("[PATCH] config: don't hardcode toolchain binaries"):
> Currently the names of the build toolchain binaries are hardcoded in
> StdGNU.mk, and the values from the environment are ignored.
> 
> Switch StdGNU.mk to use '?=' instead of '=', so that values from the
> environment are used if present, else default to the values provided
> by the config file.
> 
> This change fixes the gitlab CI loop, that was relying on passing
> custom values in the environment variables for the compiler and the
> linker.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] config: don't hardcode toolchain binaries

Posted by Andrew Cooper 16 weeks ago
On 25/06/2019 14:39, Roger Pau Monne wrote:
> Currently the names of the build toolchain binaries are hardcoded in
> StdGNU.mk, and the values from the environment are ignored.
>
> Switch StdGNU.mk to use '?=' instead of '=', so that values from the
> environment are used if present, else default to the values provided
> by the config file.
>
> This change fixes the gitlab CI loop, that was relying on passing
> custom values in the environment variables for the compiler and the
> linker.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Do we know if the CI loop still holds together with this fixed?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] config: don't hardcode toolchain binaries

Posted by Roger Pau Monné 16 weeks ago
On Tue, Jun 25, 2019 at 02:41:09PM +0100, Andrew Cooper wrote:
> On 25/06/2019 14:39, Roger Pau Monne wrote:
> > Currently the names of the build toolchain binaries are hardcoded in
> > StdGNU.mk, and the values from the environment are ignored.
> >
> > Switch StdGNU.mk to use '?=' instead of '=', so that values from the
> > environment are used if present, else default to the values provided
> > by the config file.
> >
> > This change fixes the gitlab CI loop, that was relying on passing
> > custom values in the environment variables for the compiler and the
> > linker.
> >
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Do we know if the CI loop still holds together with this fixed?

Yes, I've done a test-run with this, see:

https://gitlab.com/xen-project/people/royger/xen/pipelines/67882667

No regressions, everything was still OK.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel