From: Richard Retanubun <RichardRetanubun@RuggedCom.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Coldire: mcf52x2: Improve gcc version detection
Date: Thu, 19 Mar 2009 10:32:04 -0400 [thread overview]
Message-ID: <49C25764.8010804@RuggedCom.com> (raw)
From 2cfa4b5789a6c01f6120663cc36ca751e2e5d172 Mon Sep 17 00:00:00 2001
From: Richard Retanubun <RichardRetanubun@RuggedCom.com>
Date: Wed, 18 Mar 2009 17:12:47 -0400
Subject: [PATCH] Improved gcc version detection for more optimized code.
This patch makes the gcc version detection more flexible.
gcc 4.2+ supports -mcpu option, which allows more optimized code.
Without this patch, building on gcc 4.3.3 breaks on:
start.S:144: Error: operands mismatch -- statement `movec %d0,%RAMBAR1' ignored
Author: Len Sorensen <lsorense@csclub.uwaterloo.ca>
---
Hi TC,
Incidentally, I am also trying to move to gcc 4.3.x (4.3.3), and just saw your
patch. Len Sorensen from my team suggested this detection scheme, similar to how
linux does it, I think. (this way you will still be ok if someone still uses gcc-4.0)
I don't have enough coldfire variants to test, so I can't testify to all of them,
but the MCF5270/1 compiles ok.
- Richard
cpu/mcf52x2/config.mk | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/cpu/mcf52x2/config.mk b/cpu/mcf52x2/config.mk
index 8292736..c4726af 100644
--- a/cpu/mcf52x2/config.mk
+++ b/cpu/mcf52x2/config.mk
@@ -33,9 +33,11 @@ is5272:=$(shell grep CONFIG_M5272 $(TOPDIR)/include/$(cfg))
is5275:=$(shell grep CONFIG_M5275 $(TOPDIR)/include/$(cfg))
is5282:=$(shell grep CONFIG_M5282 $(TOPDIR)/include/$(cfg))
+# If gcc 4.2 or greater use -mcpu= otherwise use -m5307 on gcc 4.1 and older
+GCC_SUPPORTS_MCPU = $(shell if [ `echo __GNUC__ __GNUC_MINOR__ | $(CC) -E -xc - \
+ | tail -n 1 | sed -e 's/ /0/'` -gt 401 ];then echo yes; else echo no; fi)
-ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1)
-
+ifeq ($(GCC_SUPPORTS_MCPU),yes)
ifneq (,$(findstring CONFIG_M5249,$(is5249)))
PLATFORM_CPPFLAGS += -mcpu=5249
endif
--
1.5.6.5
next reply other threads:[~2009-03-19 14:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-19 14:32 Richard Retanubun [this message]
2009-03-19 21:14 ` [U-Boot] [PATCH] Coldire: mcf52x2: Improve gcc version detection Wolfgang Denk
2009-03-20 13:27 ` Richard Retanubun
2009-03-20 13:44 ` Wolfgang Denk
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=49C25764.8010804@RuggedCom.com \
--to=richardretanubun@ruggedcom.com \
--cc=u-boot@lists.denx.de \
/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