diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2012-05-12 16:39:07 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-06-12 22:42:13 -0400 |
commit | d14a5fdc26986f7bac8376a339f336be18ba2a90 (patch) | |
tree | 73c18d3e70d69c84391b4101e0553b4d03997e73 /arch | |
parent | 8e780be960c3e7000a94652bc56efeb3c932ee24 (diff) |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/Makefile | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index dbf887edabd4..aed701c7b11b 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -9,6 +9,12 @@ | |||
9 | # License. See the file "COPYING" in the main directory of this archive | 9 | # License. See the file "COPYING" in the main directory of this archive |
10 | # for more details. | 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 | isa-y := any | 18 | isa-y := any |
13 | isa-$(CONFIG_SH_DSP) := sh | 19 | isa-$(CONFIG_SH_DSP) := sh |
14 | isa-$(CONFIG_CPU_SH2) := sh2 | 20 | isa-$(CONFIG_CPU_SH2) := sh2 |
@@ -106,12 +112,6 @@ LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \ | |||
106 | KBUILD_DEFCONFIG := cayman_defconfig | 112 | KBUILD_DEFCONFIG := cayman_defconfig |
107 | endif | 113 | endif |
108 | 114 | ||
109 | ifneq ($(SUBARCH),$(ARCH)) | ||
110 | ifeq ($(CROSS_COMPILE),) | ||
111 | CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux- $(UTS_MACHINE)-linux-gnu- $(UTS_MACHINE)-unknown-linux-gnu-) | ||
112 | endif | ||
113 | endif | ||
114 | |||
115 | ifdef CONFIG_CPU_LITTLE_ENDIAN | 115 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
116 | ld-bfd := elf32-$(UTS_MACHINE)-linux | 116 | ld-bfd := elf32-$(UTS_MACHINE)-linux |
117 | LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd) | 117 | LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd) |