linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: makefile: work around toolchain bug in recent versions of binutils
Date: Thu, 2 Aug 2012 19:50:33 +0100	[thread overview]
Message-ID: <20120802185033.GA2725@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <20120802181810.GW6802@n2100.arm.linux.org.uk>

On Thu, Aug 02, 2012 at 07:18:10PM +0100, Russell King - ARM Linux wrote:
> On Thu, Aug 02, 2012 at 04:51:41PM +0100, Will Deacon wrote:
> > On Thu, Aug 02, 2012 at 04:30:30PM +0100, Russell King - ARM Linux wrote:
> > > It might just be easier to specify something like -march=armv4 or
> > > something like that, and then use .arch armv6 where required.
> > 
> > We could do that, but I worry that it will become very messy if/when people
> > start adding things like virtualisation instructions (hvc and co) to the
> > entry code. Using the same march flag for kernel and decompressor also keeps
> > everything consistent.
> 
> But you're missing a fundamental point: the decompressor is not designed
> to be built like that, it is designed to be built in such a way that it
> works unmodified on any CPU type we have to date, whether you're building
> a kernel for ARMv4 or ARMv7.
> 
> So, the code sequences which are architecture specific are only executed
> after we've checked the ID registers to determine what we should be doing
> for a particular CPU.

That's fine, *if* we can persuade the tools to build the thing for us. With
march=all, we got what we wanted but now that doesn't seem to work anymore.

> Hence, even if you're building for ARMv4, the decompressor will _still_
> contain all the support code for ARMv7 - and the assembler better accept
> those instructions too.

With recent tools, it looks like that's really hard to do... simply passing
the lowest common denominator of march=armv4 will cause the assembler to
barf on all the non-v4 code, which includes Thumb ("Error: selected processor
does not support THUMB opcodes"). It sounds like we want to pass the march
option corresponding to the highest architecture version supported by the
kernel being compiled (assuming we don't use anything that gets deprecated
by a later version of the architecture(!)).

Yuck.

> The alternative is we scatter various places with lots of yucky ifdefs,
> and it won't be pretty because quite a number of CPUs share the same code
> (which leads to long #if defined(CPU_A) || defined(CPU_B) etc).

That'll work, but let's keep it as a last resort. This is still a toolchain
issue we're dealing with here.

Will

  reply	other threads:[~2012-08-02 18:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02 12:23 [PATCH] ARM: makefile: work around toolchain bug in recent versions of binutils Will Deacon
2012-08-02 13:04 ` Russell King - ARM Linux
2012-08-02 15:01   ` Will Deacon
2012-08-02 15:30     ` Russell King - ARM Linux
2012-08-02 15:51       ` Will Deacon
2012-08-02 18:18         ` Russell King - ARM Linux
2012-08-02 18:50           ` Will Deacon [this message]
2012-08-02 19:09             ` Arnaud Patard (Rtp)
2012-08-02 19:44             ` Russell King - ARM Linux

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=20120802185033.GA2725@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).