Skip to content

Commit

Permalink
xtensa: Setup CROSS_COMPILE at the top
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geert Uytterhoeven authored and Chris Zankel committed Oct 4, 2012
1 parent 9ad79b5 commit 70cefe7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions arch/xtensa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom
VARIANT = $(variant-y)
export VARIANT

# Test for cross compiling

ifneq ($(VARIANT),)
COMPILE_ARCH = $(shell uname -m)

ifneq ($(COMPILE_ARCH), xtensa)
ifndef CROSS_COMPILE
CROSS_COMPILE = xtensa_$(VARIANT)-
endif
endif
endif

# Platform configuration

platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
Expand Down Expand Up @@ -48,18 +60,6 @@ endif

KBUILD_DEFCONFIG := iss_defconfig

# Test for cross compiling

ifneq ($(VARIANT),)
COMPILE_ARCH = $(shell uname -m)

ifneq ($(COMPILE_ARCH), xtensa)
ifndef CROSS_COMPILE
CROSS_COMPILE = xtensa_$(VARIANT)-
endif
endif
endif

# Only build variant and/or platform if it includes a Makefile

buildvar := $(shell test -e $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
Expand Down

0 comments on commit 70cefe7

Please sign in to comment.