Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: "Chen Jie" <chenj@lemote.com>,
	"Linux MIPS Mailing List" <linux-mips@linux-mips.org>,
	陈华才 <chenhc@lemote.com>, 王锐 <wangr@lemote.com>
Subject: Re: [PATCH] mips: define _MIPS_ARCH_LOONGSON3A for Loongson3
Date: Mon, 25 Aug 2014 21:41:54 +0200	[thread overview]
Message-ID: <20140825194154.GC27238@linux-mips.org> (raw)
In-Reply-To: <alpine.LFD.2.11.1408252028580.18483@eddie.linux-mips.org>

On Mon, Aug 25, 2014 at 08:35:17PM +0100, Maciej W. Rozycki wrote:

> On Mon, 25 Aug 2014, Ralf Baechle wrote:
> 
> > > >> +cflags-$(CONFIG_CPU_LOONGSON3)  += -D_MIPS_ARCH_LOONGSON3A
> > > >
> > > > The _MIPS_ARCH_* namespace belongs to GCC.  While it seems current GCC
> > > > does not define this symbol _MIPS_ARCH_LOONGSON3A runs into the danger
> > > > of causing a conflict when GCC eventually will define the symbol.
> > > When this symbol will be defined? With option '-march=loongson3a'?
> > 
> > Well, not currently (at least not in my gcc 4.9.0) - but it might.  In
> > fact, I'm wondering why it doesn't.  Maciej?
> 
>  No idea, a _MIPS_ARCH_foo macro gets defined automagically by GCC 
> whenever `-march=foo' is in effect (be it implicitly or with the use of a 
> command-line option), so there should be one.
> 
>  Has support for "loongson3a" been present in 4.9.x (it is in trunk)?  If 
> so, then what _MIPS_ARCH_* macro gets defined for `-march=loongson3a'?

Hmm - I must have fatfingered something.  Now I'm getting:

$ mips-linux-gcc < /dev/null -E -C -dM -march=loongson3a - | grep _MIPS_ARCH
#define _MIPS_ARCH_LOONGSON3A 1
#define _MIPS_ARCH "loongson3a"
$

So that would conflict with a manual definition, thus the patch would not
be acceptable as it because:

$ cat > c.c << EOF
foo(){}
EOF
$ mips-linux-gcc -D_MIPS_ARCH_LOONGSON3A -march=loongson3a -Wall -c c.c 
c.c:1:1: warning: return type defaults to ‘int’ [-Wreturn-type]
 foo(){}
 ^
c.c: In function ‘foo’:
c.c:1:1: warning: control reaches end of non-void function [-Wreturn-type]
 foo(){}
 ^
$

  Ralf

  reply	other threads:[~2014-08-25 19:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20  3:14 [PATCH 1/2] mips: .../swab.h: fix a compiling failure chenj
2014-08-20  3:14 ` [PATCH] mips: define _MIPS_ARCH_LOONGSON3A for Loongson3 chenj
2014-08-20 10:04   ` James Hogan
2014-08-20 10:04     ` James Hogan
2014-08-20 10:53   ` Ralf Baechle
2014-08-20 11:59     ` Chen Jie
2014-08-25 12:12       ` Ralf Baechle
2014-08-25 19:35         ` Maciej W. Rozycki
2014-08-25 19:41           ` Ralf Baechle [this message]
2014-08-26  1:12             ` Chen Jie
2014-08-25 12:07 ` [PATCH 1/2] mips: .../swab.h: fix a compiling failure Ralf Baechle

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=20140825194154.GC27238@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=chenhc@lemote.com \
    --cc=chenj@lemote.com \
    --cc=linux-mips@linux-mips.org \
    --cc=macro@linux-mips.org \
    --cc=wangr@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