From 370cce41da3fff41ba38feb1262002aff2d85ffd Mon Sep 17 00:00:00 2001 From: Nigel Croxon Date: Thu, 6 Nov 2014 14:41:40 -0500 Subject: [PATCH] If CROSS_COMPILE is set, ignore the ARCH value supplied on the command line and use the target machine of the cross compiler. Signed-off-by: Ard Biesheuvel Signed-off-by: Nigel Croxon --- gnu-efi-3.0/Make.defaults | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gnu-efi-3.0/Make.defaults b/gnu-efi-3.0/Make.defaults index ac24147..807205d 100644 --- a/gnu-efi-3.0/Make.defaults +++ b/gnu-efi-3.0/Make.defaults @@ -63,7 +63,12 @@ OBJCOPY := $(prefix)$(CROSS_COMPILE)objcopy # Host/target identification OS := $(shell uname -s) HOSTARCH := $(shell $(HOSTCC) -dumpmachine | cut -f1 -d- | sed s,i[3456789]86,ia32,) -ARCH := $(shell $(CC) -dumpmachine | cut -f1 -d-| sed s,i[3456789]86,ia32,) +ARCH := $(HOSTARCH) + +# Get ARCH from the compiler if cross compiling +ifneq ($(CROSS_COMPILE),) + override ARCH := $(shell $(CC) -dumpmachine | cut -f1 -d-| sed s,i[3456789]86,ia32,) +endif # FreeBSD (and possibly others) reports amd64 instead of x86_64 ifeq ($(ARCH),amd64)