linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: linux-next: omap2plus_defconfig not building
Date: Fri, 26 Nov 2010 13:53:46 +0000	[thread overview]
Message-ID: <20101126135346.GP9310@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTinOJ9T9_i=Vg6qKhDM8SXgzZYtUBxq0Dx1Pi5Vx@mail.gmail.com>

On Fri, Nov 26, 2010 at 01:31:15PM +0000, Dave Martin wrote:
> On Fri, Nov 26, 2010 at 1:00 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Fri, Nov 26, 2010 at 12:38:54PM +0000, Catalin Marinas wrote:
> >> On Fri, 2010-11-26 at 12:28 +0000, Russell King - ARM Linux wrote:
> >> > On Fri, Nov 26, 2010 at 12:22:15PM -0000, Will Deacon wrote:
> >> > > Hi Russell,
> >> > >
> >> > > > $ arm-linux-as -v -o /dev/null /dev/null
> >> > > > GNU assembler version 2.19.1 (arm-linux) using BFD version (GNU Binutils) 2.19.1
> >> > > > $ arm-linux-as -march=armv6 -mfloat-abi=soft -meabi=5 -march=armv7-a -o /dev/null t.s
> >> > > > $ arm-linux-as -march=armv6 -mfloat-abi=soft -meabi=5 -o /dev/null t.s
> >> > > > t.s: Assembler messages:
> >> > > > t.s:1: Error: selected processor does not support `ldrexb r7,[r6]'
> >> > > >
> >> > > > So it looks like someone's changed the behaviour of the assembler so it's
> >> > > > no longer possible to override the -march= argument from the gcc frontend.
> >> > > >
> >> > > > Maybe Will can shed some light on this?
> >> > >
> >> > > Well we pass -march=armv6 to GCC and -march=v7-a to the assembler using the -Wa
> >> > > option. This means that the compiler generates a .arch armv6 directive in the .s
> >> > > file and the assembler barfs.
> >> > >
> >> > > Please can you try this patch?
> >> >
> >> > We can't do this - we'll end up running ARMv7 code on ARMv6 CPUs.
> >>
> >> An alternative would be to add the '.arch armv7-a' in the inline
> >> assembly in swp_emulate.c. But that's an ugly workaround and you can't
> >> revert to the previous .arch unless you add another '.arch armv6' at the
> >> end of the asm (with lots of #ifdef's).
> >
> > Yup, so this won't work either. ?Also, as I understand it, I don't think
> > you can rely upon the compiler ordering functions wrt. asm() statements
> > outside of the function blocks, so I don't think this will work anyway.
> 
> The compiler treats inline asms as solid lumps, so providing that the
> two .arch directives are inside the affected inline asm block, it
> should work.
> 
> What you presumably can't do reliably is something like
> 
> #include <...>
> #include <...>
> 
> asm(".arch armv7-a");
> 
> ...
> 
> {
>     asm( v7-dependent code )
> }
> 
> > We could separate out the non-ARMv7 specific code into a separate file
> > (maybe called swp_emulate-init.c) and export proc_read_status and swp_hook
> > into the global namespace. ?These would have to be renamed to avoid any
> > possible clashes with other symbols.
> >
> > We could just take the view that we don't allow SWP on ARMv7 at all,
> > which would make it a pain for userspace people.
> >
> > We could also re-enable SWP support on ARMv7 without the emulation code.
> >
> > Luckily, this is the only place - at present - where we have C code built
> > containing instructions (via asm() statements) for higher versions of the
> > architecture.
> 
> For this case, I agree that separating the affected assembler out into
> a separate .S file is probably the cleanest and simplest solution...
> but I guess we should think about whether we're going to need to
> revisit this in the future.

Maybe we need to make the ability to build for several differing CPU
architectures a requirement for the toolchain people, and have a more
official way to do this than hacking around with the assembler.

  reply	other threads:[~2010-11-26 13:53 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-19 10:18 linux-next: omap2plus_defconfig not building Anand Gadiyar
2010-10-19 11:37 ` Catalin Marinas
2010-10-19 12:14   ` Anand Gadiyar
2010-10-19 22:49     ` Tony Lindgren
2010-11-08  6:05   ` Anand Gadiyar
2010-11-08  9:38     ` Uwe Kleine-König
2010-11-08  9:48     ` Catalin Marinas
2010-11-08 10:14       ` Russell King - ARM Linux
2010-11-08 10:20         ` Catalin Marinas
2010-11-08 10:25           ` Russell King - ARM Linux
2010-11-08 10:31             ` Catalin Marinas
2010-11-25 13:54       ` Anand Gadiyar
2010-11-25 16:50         ` Russell King - ARM Linux
2010-11-26 11:35           ` Anand Gadiyar
2010-11-26 11:45             ` Russell King - ARM Linux
2010-11-26 12:22               ` Will Deacon
2010-11-26 12:28                 ` Russell King - ARM Linux
2010-11-26 12:38                   ` Catalin Marinas
2010-11-26 12:55                     ` Dave Martin
2010-11-26 13:00                     ` Russell King - ARM Linux
2010-11-26 13:31                       ` Dave Martin
2010-11-26 13:53                         ` Russell King - ARM Linux [this message]
2010-11-26 12:33                 ` Russell King - ARM Linux
2010-12-23 19:55       ` Tony Lindgren
2010-12-23 20:15         ` Tony Lindgren
2010-12-23 20:30         ` Russell King - ARM Linux
2010-12-23 21:06           ` Tony Lindgren
2011-01-07  3:59             ` Tony Lindgren

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=20101126135346.GP9310@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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).