Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: Setup CROSS_COMPILE at the top

CROSS_COMPILE must be setup before using e.g. cc-option (and a few other
as-*, cc-*, ld-* macros), else they will check against the wrong compiler
when cross-compiling, and may invoke the cross compiler with wrong or
suboptimal compiler options.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: linux-sh@vger.kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by

Geert Uytterhoeven and committed by
Paul Mundt
d14a5fdc 8e780be9

+6 -6
+6 -6
arch/sh/Makefile
··· 9 9 # License. See the file "COPYING" in the main directory of this archive 10 10 # for more details. 11 11 # 12 + ifneq ($(SUBARCH),$(ARCH)) 13 + ifeq ($(CROSS_COMPILE),) 14 + CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux- $(UTS_MACHINE)-linux-gnu- $(UTS_MACHINE)-unknown-linux-gnu-) 15 + endif 16 + endif 17 + 12 18 isa-y := any 13 19 isa-$(CONFIG_SH_DSP) := sh 14 20 isa-$(CONFIG_CPU_SH2) := sh2 ··· 110 104 --defsym phys_stext_shmedia=phys_stext+1 \ 111 105 -e phys_stext_shmedia 112 106 KBUILD_DEFCONFIG := cayman_defconfig 113 - endif 114 - 115 - ifneq ($(SUBARCH),$(ARCH)) 116 - ifeq ($(CROSS_COMPILE),) 117 - CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux- $(UTS_MACHINE)-linux-gnu- $(UTS_MACHINE)-unknown-linux-gnu-) 118 - endif 119 107 endif 120 108 121 109 ifdef CONFIG_CPU_LITTLE_ENDIAN