Re: MIPS Makefile not picking up CROSS_COMPILE from environment setting

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

 



On Sun, Oct 21, 2007 at 10:37:29AM +0200, Geert Uytterhoeven wrote:

> > BTW, currently there's a discussion about such things on lkml under the
> > subject `Make m68k cross compile like every other architecture.'.
> > 
> > As you can probably guess, MIPS is unlike every other architecture, too ;-)
> 
> cc-cross-prefix got into mainline:
> 910b40468a9ce3f2f5d48c5d260329c27d45adb5

So then here is a followup patch also unlike any other ;-)

As a convenience for MIPS hacking I keep ARCH hardweired to mips though.

  Ralf

Signed-off-by: Ralf Baechle <ralf@xxxxxxxxxxxxxx>
---

 Makefile           |    7 +++++--
 arch/mips/Makefile |    6 ++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 94b8705..6ad9eda 100644
--- a/Makefile
+++ b/Makefile
@@ -165,7 +165,10 @@ export srctree objtree VPATH TOPDIR
 # then ARCH is assigned, getting whatever value it gets normally, and 
 # SUBARCH is subsequently ignored.
 
-SUBARCH := mips
+SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
+				  -e s/arm.*/arm/ -e s/sa110/arm/ \
+				  -e s/s390x/s390/ -e s/parisc64/parisc/ \
+				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
 
 # Cross compiling and selecting different set of gcc/bin-utils
 # ---------------------------------------------------------------------------
@@ -186,7 +189,7 @@ SUBARCH := mips
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
 
-ARCH		?= $(SUBARCH)
+ARCH		?= mips
 CROSS_COMPILE	?=
 
 # Architecture as present in compile.h
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 14164c2..00a3033 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -42,8 +42,10 @@ tool-prefix		= $(64bit-tool-prefix)
 UTS_MACHINE		:= mips64
 endif
 
-ifdef CONFIG_CROSSCOMPILE
-CROSS_COMPILE		:= $(tool-prefix)
+ifneq ($(SUBARCH),$(ARCH))
+  ifeq ($(CROSS_COMPILE),)
+    CROSS_COMPILE := $(call cc-cross-prefix, $(tool-prefix))
+  endif
 endif
 
 ifdef CONFIG_32BIT


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux