linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Chris Zankel <chris@zankel.net>
Subject: [PATCH 4/4] xtensa: Setup CROSS_COMPILE at the top
Date: Sat, 12 May 2012 22:39:08 +0200	[thread overview]
Message-ID: <1336855148-18817-4-git-send-email-geert@linux-m68k.org> (raw)
In-Reply-To: <1336855148-18817-1-git-send-email-geert@linux-m68k.org>

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: Chris Zankel <chris@zankel.net>
---
 arch/xtensa/Makefile |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index 7608559..d41f9ed 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -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
@@ -54,18 +66,6 @@ KBUILD_DEFCONFIG := iss_defconfig
 
 core-$(CONFIG_EMBEDDED_RAMDISK)	+= arch/xtensa/boot/ramdisk/
 
-# 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 -a $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
-- 
1.7.0.4

  parent reply	other threads:[~2012-05-12 20:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-12 20:39 [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile Geert Uytterhoeven
2012-05-12 20:39 ` Geert Uytterhoeven
2012-05-12 20:39 ` [PATCH 2/4] m68k: Setup CROSS_COMPILE at the top Geert Uytterhoeven
2012-05-13 11:38   ` Greg Ungerer
2012-05-13 11:38     ` Greg Ungerer
2012-05-12 20:39 ` [PATCH 3/4] sh: " Geert Uytterhoeven
2012-05-12 20:39 ` Geert Uytterhoeven [this message]
2012-05-12 20:39   ` [PATCH 4/4] xtensa: " Geert Uytterhoeven
2012-09-09  8:20   ` Geert Uytterhoeven
2012-09-09  8:20     ` Geert Uytterhoeven
2012-09-10 20:33     ` czankel
2012-05-13  1:01 ` [PATCH 1/4] [-next] Makefile: Do not call cc-option before including the arch's Makefile Andi Kleen
2012-05-20  9:27 ` Sam Ravnborg
2012-05-20  9:27   ` Sam Ravnborg
2012-05-25 12:29   ` Michal Marek
2012-05-25 20:29     ` Sam Ravnborg
2012-05-25 20:29       ` Sam Ravnborg
2012-06-06  9:49       ` Ingo Molnar
2012-06-15 15:10         ` Michal Marek
2012-05-25 20:32     ` H. Peter Anvin
2012-05-26 10:41       ` Michal Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336855148-18817-4-git-send-email-geert@linux-m68k.org \
    --to=geert@linux-m68k.org \
    --cc=chris@zankel.net \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).