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>,
	Greg Ungerer <gerg@uclinux.org>,
	linux-m68k@lists.linux-m68k.org
Subject: [PATCH 2/4] m68k: Setup CROSS_COMPILE at the top
Date: Sat, 12 May 2012 22:39:06 +0200	[thread overview]
Message-ID: <1336855148-18817-2-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: Greg Ungerer <gerg@uclinux.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 arch/m68k/Makefile |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index 804f139..b7f2e2d 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -16,6 +16,13 @@
 
 KBUILD_DEFCONFIG := multi_defconfig
 
+ifneq ($(SUBARCH),$(ARCH))
+	ifeq ($(CROSS_COMPILE),)
+		CROSS_COMPILE := $(call cc-cross-prefix, \
+			m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
+	endif
+endif
+
 #
 #	Enable processor type. Ordering of these is important - we want to
 #	use the minimum processor type of the range we support. The logic
@@ -62,12 +69,6 @@ endif
 
 LDFLAGS := -m m68kelf
 KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
-ifneq ($(SUBARCH),$(ARCH))
-	ifeq ($(CROSS_COMPILE),)
-		CROSS_COMPILE := $(call cc-cross-prefix, \
-			m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
-	endif
-endif
 
 ifdef CONFIG_SUN3
 LDFLAGS_vmlinux = -N
-- 
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 ` Geert Uytterhoeven [this message]
2012-05-13 11:38   ` [PATCH 2/4] m68k: Setup CROSS_COMPILE at the top 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 ` [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-2-git-send-email-geert@linux-m68k.org \
    --to=geert@linux-m68k.org \
    --cc=gerg@uclinux.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.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).