[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v2] build: assign CONFIG_CROSS_COMPILE according to priority



Hey,

the patch looks good. Thanks a lot for this fix!
I will update the commit subject to:
build: Give CROSS_COMPILE from command line highest priority

Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>

On 20.10.18 07:25, Dafna Hirschfeld wrote:
Assign CONFIG_CROSS_COMPILE to CROSS_COMPILE only
if CROSS_COMPILE is defined, so that CONFIG_CROSS_COMPILE
will not be erased in case it was set in `.config`

Signed-off-by: Dafna Hirschfeld <dafna3@xxxxxxxxx>
---
  Makefile                    | 3 +++
  arch/arm/arm/Compiler.uk    | 2 +-
  arch/arm/arm64/Compiler.uk  | 2 +-
  arch/x86/x86_64/Compiler.uk | 2 +-
  4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 1e2d035..efc94a1 100644
--- a/Makefile
+++ b/Makefile
@@ -390,7 +390,10 @@ unexport MACHINE
  # "make" in the configured kernel build directory always uses that.
  # Default value for CONFIG_CROSS_COMPILE is not to prefix executables
  # Note: Some architectures assign CONFIG_CROSS_COMPILE in their 
arch/*/Makefile.uk
+
+ifneq ("$(origin CROSS_COMPILE)","undefined")
  CONFIG_CROSS_COMPILE := $(CROSS_COMPILE:"%"=%)
+endif
include $(CONFIG_UK_BASE)/arch/$(UK_FAMILY)/Compiler.uk diff --git a/arch/arm/arm/Compiler.uk b/arch/arm/arm/Compiler.uk
index 44a497d..3345d03 100644
--- a/arch/arm/arm/Compiler.uk
+++ b/arch/arm/arm/Compiler.uk
@@ -1,5 +1,5 @@
  # set cross compile
-ifeq ($(CONFIG_CROSS_COMPILE),)
+ifeq ($(call qstrip,$(CONFIG_CROSS_COMPILE)),)
  ifneq ($(CONFIG_UK_ARCH),$(HOSTARCH))
        CONFIG_CROSS_COMPILE := arm-linux-gnueabihf-
  endif
diff --git a/arch/arm/arm64/Compiler.uk b/arch/arm/arm64/Compiler.uk
index 4572013..235346b 100644
--- a/arch/arm/arm64/Compiler.uk
+++ b/arch/arm/arm64/Compiler.uk
@@ -1,5 +1,5 @@
  # set cross compile
-ifeq ($(CONFIG_CROSS_COMPILE),)
+ifeq ($(call qstrip,$(CONFIG_CROSS_COMPILE)),)
  ifneq ($(CONFIG_UK_ARCH),$(HOSTARCH))
        CONFIG_CROSS_COMPILE := aarch64-linux-gnu-
  endif
diff --git a/arch/x86/x86_64/Compiler.uk b/arch/x86/x86_64/Compiler.uk
index 98ea8ad..dbe0971 100644
--- a/arch/x86/x86_64/Compiler.uk
+++ b/arch/x86/x86_64/Compiler.uk
@@ -1,5 +1,5 @@
  # set cross compile
-ifeq ($(CONFIG_CROSS_COMPILE),)
+ifeq ($(call qstrip,$(CONFIG_CROSS_COMPILE)),)
  ifneq ($(CONFIG_UK_ARCH),$(HOSTARCH))
        CONFIG_CROSS_COMPILE := x86_64-linux-gnu-
  endif


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.