diff options
| author | Geert Uytterhoeven <geert@linux-m68k.org> | 2012-05-12 16:39:08 -0400 |
|---|---|---|
| committer | Chris Zankel <chris@zankel.net> | 2012-10-04 15:16:20 -0400 |
| commit | 70cefe765433529fc894fd1995a1d5883cb33e05 (patch) | |
| tree | 0b14a9b513805c8b5a3611c2862e96155ae970e3 | |
| parent | 9ad79b58510b2845e5ffa77654596d7184a827ab (diff) | |
xtensa: 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>
Signed-off-by: Chris Zankel <chris@zankel.net>
| -rw-r--r-- | arch/xtensa/Makefile | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile index 735916b3daee..bb5ba61723f7 100644 --- a/arch/xtensa/Makefile +++ b/arch/xtensa/Makefile | |||
| @@ -21,6 +21,18 @@ variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom | |||
| 21 | VARIANT = $(variant-y) | 21 | VARIANT = $(variant-y) |
| 22 | export VARIANT | 22 | export VARIANT |
| 23 | 23 | ||
| 24 | # Test for cross compiling | ||
| 25 | |||
| 26 | ifneq ($(VARIANT),) | ||
| 27 | COMPILE_ARCH = $(shell uname -m) | ||
| 28 | |||
| 29 | ifneq ($(COMPILE_ARCH), xtensa) | ||
| 30 | ifndef CROSS_COMPILE | ||
| 31 | CROSS_COMPILE = xtensa_$(VARIANT)- | ||
| 32 | endif | ||
| 33 | endif | ||
| 34 | endif | ||
| 35 | |||
| 24 | # Platform configuration | 36 | # Platform configuration |
| 25 | 37 | ||
| 26 | platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000 | 38 | platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000 |
| @@ -48,18 +60,6 @@ endif | |||
| 48 | 60 | ||
| 49 | KBUILD_DEFCONFIG := iss_defconfig | 61 | KBUILD_DEFCONFIG := iss_defconfig |
| 50 | 62 | ||
| 51 | # Test for cross compiling | ||
| 52 | |||
| 53 | ifneq ($(VARIANT),) | ||
| 54 | COMPILE_ARCH = $(shell uname -m) | ||
| 55 | |||
| 56 | ifneq ($(COMPILE_ARCH), xtensa) | ||
| 57 | ifndef CROSS_COMPILE | ||
| 58 | CROSS_COMPILE = xtensa_$(VARIANT)- | ||
| 59 | endif | ||
| 60 | endif | ||
| 61 | endif | ||
| 62 | |||
| 63 | # Only build variant and/or platform if it includes a Makefile | 63 | # Only build variant and/or platform if it includes a Makefile |
| 64 | 64 | ||
| 65 | buildvar := $(shell test -e $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/) | 65 | buildvar := $(shell test -e $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/) |
