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

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



Hi Dafna,

thanks a lot for this patch. Sorry for my late reply.
I have a few comments inline but this fix should definitely go in. ;-)

Cheers,

Simon

On 24.09.2018 09:44, 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 96be2db..8316c45 100644
--- a/Makefile
+++ b/Makefile
@@ -392,7 +392,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

Good point.

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..ae60913 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 ($(filter-out "",$(CONFIG_CROSS_COMPILE)),)

Hum, do you want to filter out a quoted empty value?
We have the function qstrip which you could use instead:

  ifeq ($(call qstrip,$(CONFIG_CROSS_COMPILE)),)

This one strips even out additional whitespaces. So you would also filter out something like " " or " ".

  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..016b26b 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 ($(filter-out "",$(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..47edc9b 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 ($(filter-out "",$(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®.