linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wu Zhangjin <wuzhangjin@gmail.com>
To: Arnaud Patard <apatard@mandriva.com>
Cc: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>,
	Yan Hua <yanh@lemote.com>, Philippe Vachon <philippe@cowpig.ca>,
	Zhang Le <r0bertz@gentoo.org>, Zhang Fuxin <zhangfx@lemote.com>,
	loongson-dev <loongson-dev@googlegroups.com>,
	Nicholas Mc Guire <der.herr@hofr.at>,
	Liu Junliang <liujl@lemote.com>, Erwan Lerale <erwan@thiscow.com>
Subject: Re: [loongson-PATCH-v2 20/23] add gcc 4.4 support for MIPS and loongson
Date: Wed, 27 May 2009 22:23:02 +0800	[thread overview]
Message-ID: <1243434182.11263.3.camel@falcon> (raw)
In-Reply-To: <m33aaqq4ro.fsf@anduin.mandriva.com>

On Wed, 2009-05-27 at 11:22 +0200, Arnaud Patard wrote:
> wuzhangjin@gmail.com writes:
> Hi,
> 
> > From: Wu Zhangjin <wuzj@lemote.com>
> >
> > the gcc 4.4 support for MIPS mostly refer to this PATCH:
> > http://www.nabble.com/-PATCH--MIPS:-Handle-removal-of-%27h%27-constraint-in-GCC-4.4-td22192768.html
> > but have been tuned a little.
> >
> > because only gcc 4.4 have loongson-specific support, so, we need to
> > choose the suitable -march argument for gcc <= 4.3 and gcc >= 4.4, and
> > we also need to consider use -march=loongson2e and -march=loongson2f for
> > loongson2e and loongson2f respectively. this is handled by adding two
> > new kernel options: CPU_LOONGSON2E and CPU_LOONGSON2F(thanks for the
> > solutin provided by ZhangLe).
> >
> > I have tested it on FuLoong(2f) in 32bit and 64bit with gcc-4.4 and
> > gcc-4.3. so, basically, it works.
> >
> > Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
> > ---
> >  arch/mips/Makefile               |    9 +++++-
> >  arch/mips/include/asm/compiler.h |   10 ++++++
> >  arch/mips/include/asm/delay.h    |   58 +++++++++++++++++++++++++------------
> >  3 files changed, 57 insertions(+), 20 deletions(-)
> >
> > diff --git a/arch/mips/Makefile b/arch/mips/Makefile
> > index a25c2e5..1ee5504 100644
> > --- a/arch/mips/Makefile
> > +++ b/arch/mips/Makefile
> > @@ -120,7 +120,14 @@ cflags-$(CONFIG_CPU_R4300)	+= -march=r4300 -Wa,--trap
> >  cflags-$(CONFIG_CPU_VR41XX)	+= -march=r4100 -Wa,--trap
> >  cflags-$(CONFIG_CPU_R4X00)	+= -march=r4600 -Wa,--trap
> >  cflags-$(CONFIG_CPU_TX49XX)	+= -march=r4600 -Wa,--trap
> > -cflags-$(CONFIG_CPU_LOONGSON2)	+= -march=r4600 -Wa,--trap
> > +
> > +# only gcc >= 4.4 have the loongson-specific support
> > +cflags-$(CONFIG_CPU_LOONGSON2)	+= -Wa,--trap
> > +cflags-$(CONFIG_CPU_LOONGSON2E)	+= $(shell if [ $(call cc-version) -lt 0440 ] ; then \
> > +	echo $(call cc-option,-march=r4600); else echo $(call cc-option,-march=loongson2e); fi ;)
> > +cflags-$(CONFIG_CPU_LOONGSON2F)	+= $(shell if [ $(call cc-version) -lt 0440 ] ; then \
> > +	echo $(call cc-option,-march=r4600); else echo $(call cc-option,-march=loongson2f); fi ;)
> > +
> 
> why not using something like that ? :
>         cflags-$(CONFIG_LOONGSON2E) += \
>                 $(call cc-option,-march=loongson2e,$(call cc-option,-march=r4600))
>         cflags-$(CONFIG_LOONGSON2F) += \
>                 $(call cc-option,-march=loongson2f,$(call cc-option,-march=r4600))
> 

applied.

Documentation/kbuild/makefiles.txt:

  cc-option is used to check if $(CC) supports a given option, and not
  supported to use an optional second option.

thx!
Wu Zhangjin

  reply	other threads:[~2009-05-27 14:23 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26 18:59 [loongson-PATCH-v2 00/23] loongson-based machines support wuzhangjin
2009-05-26 19:01 ` [loongson-PATCH-v2 01/23] fix-warning: incompatible argument type of pci_fixup_irqs wuzhangjin
2009-05-26 19:02 ` [loongson-PATCH-v2 02/23] fix-warning: incompatible argument type of virt_to_phys wuzhangjin
2009-05-26 19:02 ` [loongson-PATCH-v2 03/23] change the naming methods wuzhangjin
2009-05-26 19:03 ` [loongson-PATCH-v2 04/23] remove reference to bonito64.h wuzhangjin
2009-05-26 19:04 ` [loongson-PATCH-v2 05/23] divide the files to the smallest logic unit wuzhangjin
2009-05-26 19:04 ` [loongson-PATCH-v2 06/23] replace tons of magic numbers by understandable symbols wuzhangjin
2009-05-27  9:27   ` Arnaud Patard
2009-05-27 15:26     ` Wu Zhangjin
2009-05-26 19:05 ` [loongson-PATCH-v2 07/23] clean up the early printk support for fuloong(2e) wuzhangjin
2009-05-26 19:05 ` [loongson-PATCH-v2 08/23] enable Real Time Clock Support " wuzhangjin
2009-05-26 19:05 ` [loongson-PATCH-v2 09/23] split the loongson-specific part out wuzhangjin
2009-05-26 19:06 ` [loongson-PATCH-v2 10/23] add basic loongson-2f support wuzhangjin
2009-05-26 19:06 ` [loongson-PATCH-v2 11/23] add basic fuloong(2f) support wuzhangjin
2009-05-26 19:07 ` [loongson-PATCH-v2 12/23] enable serial port support of loongson-based machines wuzhangjin
2009-05-26 19:07 ` [loongson-PATCH-v2 13/23] add basic yeeloong(2f) laptop support wuzhangjin
2009-05-26 19:07 ` [loongson-PATCH-v2 14/23] Add Siliconmotion 712 framebuffer driver wuzhangjin
2009-05-26 21:10   ` Geert Uytterhoeven
2009-05-26 21:10     ` Geert Uytterhoeven
2009-05-26 19:07 ` [loongson-PATCH-v2 15/23] define Loongson2F arch specific phys prot access wuzhangjin
2009-05-26 19:08 ` [loongson-PATCH-v2 16/23] Loongson2 specific OProfile driver wuzhangjin
2009-05-26 19:08 ` [loongson-PATCH-v2 17/23] flush posted write to irq wuzhangjin
2009-05-26 19:08 ` [loongson-PATCH-v2 18/23] CS5536 MFGPT as system clock source support wuzhangjin
2009-05-26 19:08 ` [loongson-PATCH-v2 19/23] Loongson2F cpufreq support wuzhangjin
2009-05-27  9:46   ` Arnaud Patard
2009-05-27 17:37     ` Wu Zhangjin
2009-05-27 17:37       ` Wu Zhangjin
2009-05-27 19:18       ` Arnaud Patard
2009-05-27 19:18         ` Arnaud Patard
2009-05-27 10:01   ` Manuel Lauss
2009-05-27 18:28     ` Wu Zhangjin
2009-05-26 19:09 ` [loongson-PATCH-v2 20/23] add gcc 4.4 support for MIPS and loongson wuzhangjin
2009-05-27  9:22   ` Arnaud Patard
2009-05-27 14:23     ` Wu Zhangjin [this message]
2009-05-26 19:09 ` [loongson-PATCH-v2 21/23] add default kernel config file for loongson-based machines wuzhangjin
2009-05-26 19:09 ` [loongson-PATCH-v2 22/23] add a default kernel configration for yeeloong-7inch laptop wuzhangjin
2009-05-26 19:10 ` [loongson-PATCH-v2 23/23] Hibernation Support in mips system wuzhangjin
2009-05-27  9:51   ` Arnaud Patard
2009-05-27 18:52     ` Wu Zhangjin
2009-05-28 15:44       ` Atsushi Nemoto
2009-05-28 17:06         ` Wu Zhangjin
2009-05-28 15:32     ` Atsushi Nemoto
2009-05-28 17:10   ` Wu Zhangjin
2009-05-29 16:12     ` Atsushi Nemoto
2009-05-29 19:12       ` Wu Zhangjin

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=1243434182.11263.3.camel@falcon \
    --to=wuzhangjin@gmail.com \
    --cc=apatard@mandriva.com \
    --cc=der.herr@hofr.at \
    --cc=erwan@thiscow.com \
    --cc=linux-mips@linux-mips.org \
    --cc=liujl@lemote.com \
    --cc=loongson-dev@googlegroups.com \
    --cc=philippe@cowpig.ca \
    --cc=r0bertz@gentoo.org \
    --cc=ralf@linux-mips.org \
    --cc=yanh@lemote.com \
    --cc=zhangfx@lemote.com \
    /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).