Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Kumba <kumba@gentoo.org>
To: linux-mips@linux-mips.org
Subject: Re: GCCFLAGS for gcc 3.3.x (-march and _MIPS_ISA)
Date: Tue, 12 Aug 2003 02:49:48 -0400	[thread overview]
Message-ID: <3F388E0C.50802@gentoo.org> (raw)
In-Reply-To: <20030812.152654.74756131.nemoto@toshiba-tops.co.jp>

Atsushi Nemoto wrote:

> I'm trying to compile kernel with gcc 3.3.1 and binutils 2.14.  I
> found this report on this ML:
> 
> 
>>>>>>On Tue, 13 May 2003 13:33:16 +0200, Guido Guenther <agx@sigxcpu.org> said:
> 
> Guido> Just for completeness: I had to use:
> Guido>  GCCFLAGS += -mabi=32 -march=r4600 -mtune=r4600 -Wa,--trap
> Guido> to make gcc-3.3 happy (note the 32 instead of o32). gcc-3.2
> Guido> doesn't seem to handle these options correctly at all.
> 
> It can compile the kernel, but handle_adel_int (and handle_ades_int)
> contain wrong codes.
> 
> 8002630c <handle_adel_int> 40284000 	dmfc0	t0,$8
> 80026310 <handle_adel_int+0x4> 00000000 	nop
> 80026314 <handle_adel_int+0x8> ffa800a4 	sd	t0,164(sp)
> 
> The source code for this instructions are:
> 
> #define __BUILD_clear_ade(exception)                                    \
> 		.set	reorder;					\
> 		MFC0	t0,CP0_BADVADDR;                                \
> 		.set	noreorder;					\
> 		REG_S	t0,PT_BVADDR(sp);                               \
> 		KMODE
> 
> The macro MFC0 and REG_S are defined asm.h and depend on _MIPS_ISA.
> 
> #if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || \
>     (_MIPS_ISA == _MIPS_ISA_MIPS32)
> #define MFC0		mfc0
> #define MTC0		mtc0
> #endif
> #if (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || \
>     (_MIPS_ISA == _MIPS_ISA_MIPS5) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
> #define MFC0		dmfc0
> #define MTC0		dmtc0
> #endif
> 
> The option -march=r4600 seems to make gcc 3.3.x choose MIPS_ISA_MIPS3.
> 
> So, the right options is:
> 
> 	GCCFLAGS += -mabi=32 -march=mips2 -mtune=r4600 -Wa,--trap
> (or	GCCFLAGS += $(call check_gcc, -mcpu=r4600 -mips2, -mabi=32 -march=mips2 -mtune=r4600) -Wa,--trap)
> 
> Isn't it?
> 
> ---
> Atsushi Nemoto


I don't claim to be an expert on all things mips yet, but If I recall 
correctly, the R4K processor line is a MIPS III capable processor.  So 
-mips3 -mabi=32 should be safe for it.  I've been building kernels off 
linux-mips.org CVS using "-mips3 -mabi=32 -Wa,--trap" in the 
arch/mips/Makefile, and it works great.

Several people I know using Indy's with R5000 processors use "-mips4 
-mabi=32 -Wa,--trap" (cause R5K is MIPS IV).  I know with gcc-3.3.x, 
-mipsX is just a synonym for the appropriate -march specifier, so it 
doesn't seem to make a different whether one uses -march or -mipsX.

I'm slowly working on building a Gentoo install using "-mips3 -mabi=32" 
code on my Indigo2 (Right now, it's a mix of -mips2 and -mips3 with a 
random -mips1 binary scattered around).  Quite a fun, albeit slow, 
experiment.


--Kumba

-- 
"Such is oft the course of deeds that move the wheels of the world: 
small hands do them because they must, while the eyes of the great are 
elsewhere."  --Elrond

  reply	other threads:[~2003-08-12  6:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-12  6:26 GCCFLAGS for gcc 3.3.x (-march and _MIPS_ISA) Atsushi Nemoto
2003-08-12  6:49 ` Kumba [this message]
2003-08-12  7:06   ` Thiemo Seufer
2003-08-12  7:56     ` Kumba
2003-08-12  8:10       ` Thiemo Seufer
2003-08-12  8:26         ` Kumba
2003-08-12  9:25   ` Atsushi Nemoto
2003-08-19  3:52     ` Ralf Baechle
2003-08-12  6:51 ` Thiemo Seufer
2003-08-12 10:06   ` Atsushi Nemoto
2003-08-12 10:16     ` Thiemo Seufer
2003-08-12 15:26       ` Atsushi Nemoto
2003-08-14  3:03         ` Thiemo Seufer
2003-08-12 13:56   ` Maciej W. Rozycki
2003-08-12 14:04     ` Thiemo Seufer
2003-08-12 14:40       ` Maciej W. Rozycki
2003-08-14  3:08         ` Thiemo Seufer
2003-08-19  3:38       ` Ralf Baechle
2003-08-19 12:22         ` Maciej W. Rozycki
2003-08-19 12:34           ` Ralf Baechle
2003-08-19  3:57   ` Ralf Baechle
2003-08-19  6:41     ` Thiemo Seufer

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=3F388E0C.50802@gentoo.org \
    --to=kumba@gentoo.org \
    --cc=linux-mips@linux-mips.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