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>,
	Paul Mundt <lethal@linux-sh.org>,
	linux-sh@vger.kernel.org
Subject: [PATCH 3/4] sh: Setup CROSS_COMPILE at the top
Date: Sat, 12 May 2012 22:39:07 +0200	[thread overview]
Message-ID: <1336855148-18817-3-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: Paul Mundt <lethal@linux-sh.org>
Cc: linux-sh@vger.kernel.org
---
 arch/sh/Makefile |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 46edf07..0d7bbaf 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -9,6 +9,12 @@
 # License.  See the file "COPYING" in the main directory of this archive
 # for more details.
 #
+ifneq ($(SUBARCH),$(ARCH))
+  ifeq ($(CROSS_COMPILE),)
+    CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux-  $(UTS_MACHINE)-linux-gnu-  $(UTS_MACHINE)-unknown-linux-gnu-)
+  endif
+endif
+
 isa-y					:= any
 isa-$(CONFIG_SH_DSP)			:= sh
 isa-$(CONFIG_CPU_SH2)			:= sh2
@@ -106,12 +112,6 @@ LDFLAGS_vmlinux		+= --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \
 KBUILD_DEFCONFIG	:= cayman_defconfig
 endif
 
-ifneq ($(SUBARCH),$(ARCH))
-  ifeq ($(CROSS_COMPILE),)
-    CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux-  $(UTS_MACHINE)-linux-gnu-  $(UTS_MACHINE)-unknown-linux-gnu-)
-  endif
-endif
-
 ifdef CONFIG_CPU_LITTLE_ENDIAN
 ld-bfd			:= elf32-$(UTS_MACHINE)-linux
 LDFLAGS_vmlinux		+= --defsym 'jiffies=jiffies_64' --oformat $(ld-bfd)
-- 
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 ` Geert Uytterhoeven [this message]
2012-05-12 20:39 ` [PATCH 4/4] xtensa: " Geert Uytterhoeven
2012-05-12 20:39   ` 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-3-git-send-email-geert@linux-m68k.org \
    --to=geert@linux-m68k.org \
    --cc=lethal@linux-sh.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@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).