From: Al Viro <viro@ftp.linux.org.uk>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Hirokazu Takata <takata@linux-m32r.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] m32r: set CHECKFLAGS properly
Date: Wed, 28 Sep 2005 01:18:40 +0100 [thread overview]
Message-ID: <20050928001840.GW7992@ftp.linux.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.58.0509270758040.3308@g5.osdl.org>
On Tue, Sep 27, 2005 at 08:00:03AM -0700, Linus Torvalds wrote:
>
>
> On Tue, 27 Sep 2005, Hirokazu Takata wrote:
> >
> > Now, the endianness is to be determined by a (cross)compiler:
> > - For the big-endian, a compiler (m32r-linux-gcc or m32r-linux-gnu-gcc)
> > provides a predefined macro __BIG_ENDIAN__.
> > - For little-endian, a compiler (m32rle-linux-gcc or m32rle-linux-gnu-gcc)
> > provides a predefined macro __LITTLE_ENDIAN__.
>
> Hmm.. You need to tell sparse _some_ way which one you use, since sparse
> won't do it.
>
> Picking one at random is fine, of course. It doesn't even have to match
> the one you'll compile with, although that means that sparse will
> obviously be testing a different configuration than the one you'd actually
> compile.
>
> So I think having -D__BIG_ENDIAN__ in the sparse flags is better than not
> having anything at all (since otherwise it won't be able to check
> anything). And having something that matches the compiler would be better
> still.
Really interesting question is why do we need two toolchains at all.
Note that little-endian m32r gcc at least appears to understand
-mbe/-mbig-endian and binutils handles both endianness just fine.
Does that really work and is there any reason why big-endian one
could not handle -mle the same way with minimal changes? IOW, do
they have to differ in anything except the default target endianness?
Note that dependencies on "host endianness == target endianness" are
practically guaranteed to cause bugs in cross-compiler, so any of
those would very likely to be a bug in need of fixing anyway...
next prev parent reply other threads:[~2005-09-28 0:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-26 5:18 [PATCH] m32r: set CHECKFLAGS properly Al Viro
2005-09-27 6:13 ` Hirokazu Takata
2005-09-27 7:10 ` Al Viro
2005-09-27 15:13 ` Kyle Moffett
2005-09-27 16:34 ` Al Viro
2005-09-27 17:31 ` Kyle Moffett
2005-09-27 17:55 ` Al Viro
2005-09-27 18:37 ` Kyle Moffett
2005-09-27 23:06 ` Al Viro
2005-09-27 20:02 ` Sam Ravnborg
2005-09-28 1:44 ` Al Viro
2005-09-27 6:23 ` Hirokazu Takata
2005-09-27 15:00 ` Linus Torvalds
2005-09-28 0:18 ` Al Viro [this message]
2005-09-28 10:04 ` Hirokazu Takata
2005-09-29 1:56 ` Al Viro
-- strict thread matches above, loose matches on Subject: below --
2005-09-26 5:19 Al Viro
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=20050928001840.GW7992@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=takata@linux-m32r.org \
--cc=torvalds@osdl.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