public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Fwd: selected processor does not support `rev r7,r7'
       [not found]         ` <20190321080614.jmpycfyetz4rugui@pengutronix.de>
@ 2019-03-21  8:24           ` Lewis Zhou
  2019-03-21  8:40             ` Austin Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Lewis Zhou @ 2019-03-21  8:24 UTC (permalink / raw)
  To: crossgcc

Hi,

I recently tried to compile the barebox bootloaer with the
arm-cortex_a8-linux-gnueabihf configuration which is based on the
sample configuration arm-cortex_a8-linux-gnueabi with the hardware
float enabled.

However, the compiler (gcc) seems not support -march=armv7-a flag. I
think something is wrong as the cortex_a8 is a sub-architecture of
armv7-a.

The toolchain failed to compile both the barebox and the linux kernel
(4.19). Please help! Attached is a response from the barebox mailing
list.


Kind regards,
Lewis

---------- Forwarded message ---------
From: Sascha Hauer <s.hauer@pengutronix.de>
Date: Thu, Mar 21, 2019 at 4:06 PM
Subject: Re: selected processor does not support `rev r7,r7'
To: Lewis Zhou <lewisou@gmail.com>
Cc: <barebox@lists.infradead.org>


On Thu, Mar 21, 2019 at 03:53:06PM +0800, Lewis Zhou wrote:
> Hi Sascha,
>
> Here's the log:
>
> make -f scripts/Makefile.build obj=common
>
> arm-cortex_a8-linux-gnueabihf-gcc -Wp,-MD,common/.memory.o.d
> -nostdinc -isystem
> /home/lewis/x-tools/arm-cortex_a8-linux-gnueabihf/lib/gcc/arm-cortex_a8-linux-gnueabihf/8.3.0/include
> -D__KERNEL__ -D__BAREBOX__ -Iinclude
> -I/home/lewis/OpenProj/barebox/dts/include
> -I/home/lewis/OpenProj/barebox/arch/arm/include
> -I/home/lewis/OpenProj/barebox/arch/arm/include -include
> /home/lewis/OpenProj/barebox/include/linux/kconfig.h -fno-builtin
> -ffreestanding -D__ARM__ -fno-strict-aliasing -marm -mlittle-endian
> -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=7
> -march=armv5t -Wa,-march=armv7-a  -msoft-float -mthumb

-march=armv5t -Wa,-march=armv7-a shouldn't be here. It comes from this
line in arch/arm/Makefile:

arch-$(CONFIG_CPU_32v7)         :=-D__LINUX_ARM_ARCH__=7 $(call
cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)

This means the build process will use "-march=armv7-a" when the compiler
supports it. Apparently it does not, so it will fall back to
"-march=armv5t -Wa,-march=armv7-a". armv5t doesn't support thumb2 code,
only thumb and as it seems thumb does not support the "rev" instruction.

Your compiler should really support "-march=armv7-a". If it doesn't I
really think there is something wrong with it.

Sascha

--
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: selected processor does not support `rev r7,r7'
  2019-03-21  8:24           ` Fwd: selected processor does not support `rev r7,r7' Lewis Zhou
@ 2019-03-21  8:40             ` Austin Morton
       [not found]               ` <CAD_PvuaROBDHod3XjFFgZ6Qic3pHhRSP=qFbQ5MHwGJs=js+0g@mail.gmail.com>
       [not found]               ` <CAD_Pvub+CwCM_ys72JiQ9jgQ_Gz=+qdsz7o2MK-6nV7icfSzZQ@mail.gmail.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Austin Morton @ 2019-03-21  8:40 UTC (permalink / raw)
  To: Lewis Zhou; +Cc: crossgcc maillist

Any recent version of gcc should spit out a list of supported March values
if invoked with an invalid value. (read gcc 7 or higher).

What does this command output on your compiler?

# gcc -E -march=help -xc /dev/null

https://stackoverflow.com/questions/47299458/how-can-i-determine-what-architectures-gcc-supports

On Thu, Mar 21, 2019, 04:25 Lewis Zhou <lewisou@gmail.com> wrote:

> Hi,
>
> I recently tried to compile the barebox bootloaer with the
> arm-cortex_a8-linux-gnueabihf configuration which is based on the
> sample configuration arm-cortex_a8-linux-gnueabi with the hardware
> float enabled.
>
> However, the compiler (gcc) seems not support -march=armv7-a flag. I
> think something is wrong as the cortex_a8 is a sub-architecture of
> armv7-a.
>
> The toolchain failed to compile both the barebox and the linux kernel
> (4.19). Please help! Attached is a response from the barebox mailing
> list.
>
>
> Kind regards,
> Lewis
>
> ---------- Forwarded message ---------
> From: Sascha Hauer <s.hauer@pengutronix.de>
> Date: Thu, Mar 21, 2019 at 4:06 PM
> Subject: Re: selected processor does not support `rev r7,r7'
> To: Lewis Zhou <lewisou@gmail.com>
> Cc: <barebox@lists.infradead.org>
>
>
> On Thu, Mar 21, 2019 at 03:53:06PM +0800, Lewis Zhou wrote:
> > Hi Sascha,
> >
> > Here's the log:
> >
> > make -f scripts/Makefile.build obj=common
> >
> > arm-cortex_a8-linux-gnueabihf-gcc -Wp,-MD,common/.memory.o.d
> > -nostdinc -isystem
> >
> /home/lewis/x-tools/arm-cortex_a8-linux-gnueabihf/lib/gcc/arm-cortex_a8-linux-gnueabihf/8.3.0/include
> > -D__KERNEL__ -D__BAREBOX__ -Iinclude
> > -I/home/lewis/OpenProj/barebox/dts/include
> > -I/home/lewis/OpenProj/barebox/arch/arm/include
> > -I/home/lewis/OpenProj/barebox/arch/arm/include -include
> > /home/lewis/OpenProj/barebox/include/linux/kconfig.h -fno-builtin
> > -ffreestanding -D__ARM__ -fno-strict-aliasing -marm -mlittle-endian
> > -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=7
> > -march=armv5t -Wa,-march=armv7-a  -msoft-float -mthumb
>
> -march=armv5t -Wa,-march=armv7-a shouldn't be here. It comes from this
> line in arch/arm/Makefile:
>
> arch-$(CONFIG_CPU_32v7)         :=-D__LINUX_ARM_ARCH__=7 $(call
> cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
>
> This means the build process will use "-march=armv7-a" when the compiler
> supports it. Apparently it does not, so it will fall back to
> "-march=armv5t -Wa,-march=armv7-a". armv5t doesn't support thumb2 code,
> only thumb and as it seems thumb does not support the "rev" instruction.
>
> Your compiler should really support "-march=armv7-a". If it doesn't I
> really think there is something wrong with it.
>
> Sascha
>
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: selected processor does not support `rev r7,r7'
       [not found]               ` <CAD_PvuaROBDHod3XjFFgZ6Qic3pHhRSP=qFbQ5MHwGJs=js+0g@mail.gmail.com>
@ 2019-03-21  9:15                 ` Austin Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Austin Morton @ 2019-03-21  9:15 UTC (permalink / raw)
  To: Lewis Zhou; +Cc: crossgcc maillist, barebox, Sascha Hauer

Looks like Kbuilds cc-option is failing somehow.

Can you do a clean build with V=1 and post the whole log? Hopefully that
should show the invocations kbuild is doing.

Side note, I don't really understand this bit
> -march=armv5t -Wa,-march=armv7-a

This is telling cc to use march=armv5t and the assembler to use armv7-a. I
can't think of a scenario where this would be desired, but maybe I am
overlooking something.

Without digging too far, the failing object file (memory.o) is a fairly
small c file that includes no obvious inline assembly (although I didn't
look to far into it's includes), so to me it seems like the compiler is
generating assembly that the assembler finds to be invalid. Presumably
because they are operating with differing march flags.

But anyway, the root issue is that kbuild is incorrectly identifying your
compiler does not support armv7-a


On Thu, Mar 21, 2019, 04:49 Lewis Zhou <lewisou@gmail.com> wrote:

> Hi Austin,
>
> Here's the list. armv7-a is on the list.
>
> lewis@lewis-ubuntu:~/x-tools/arm-cortex_a8-linux-gnueabihf/bin$
> ./arm-cortex_a8-linux-gnueabihf-gcc -E -march=help -xc /dev/null
> arm-cortex_a8-linux-gnueabihf-gcc: error: unrecognized -march target: help
> arm-cortex_a8-linux-gnueabihf-gcc: note: valid arguments are: armv2
> armv2a armv3 armv3m armv4 armv4t armv5 armv5t armv5e armv5te armv5tej
> armv6 armv6j armv6k armv6z armv6kz armv6zk armv6t2 armv6-m armv6s-m
> armv7 armv7-a armv7ve armv7-r armv7-m armv7e-m armv8-a armv8.1-a
> armv8.2-a armv8.3-a armv8.4-a armv8-m.base armv8-m.main armv8-r iwmmxt
> iwmmxt2
> arm-cortex_a8-linux-gnueabihf-gcc: error: missing argument to '-march='
>
> That's strange. When compiling both barebox and linux. I always got errors
> like:
>
> "selected processor does not support `rev r7,r7'
>
>
> Kind regards,
> Lewis
>
>
>
> On Thu, Mar 21, 2019 at 4:40 PM Austin Morton <austinpmorton@gmail.com>
> wrote:
> >
> > Any recent version of gcc should spit out a list of supported March
> values if invoked with an invalid value. (read gcc 7 or higher).
> >
> > What does this command output on your compiler?
> >
> > # gcc -E -march=help -xc /dev/null
> >
> >
> https://stackoverflow.com/questions/47299458/how-can-i-determine-what-architectures-gcc-supports
> >
> > On Thu, Mar 21, 2019, 04:25 Lewis Zhou <lewisou@gmail.com> wrote:
> >>
> >> Hi,
> >>
> >> I recently tried to compile the barebox bootloaer with the
> >> arm-cortex_a8-linux-gnueabihf configuration which is based on the
> >> sample configuration arm-cortex_a8-linux-gnueabi with the hardware
> >> float enabled.
> >>
> >> However, the compiler (gcc) seems not support -march=armv7-a flag. I
> >> think something is wrong as the cortex_a8 is a sub-architecture of
> >> armv7-a.
> >>
> >> The toolchain failed to compile both the barebox and the linux kernel
> >> (4.19). Please help! Attached is a response from the barebox mailing
> >> list.
> >>
> >>
> >> Kind regards,
> >> Lewis
> >>
> >> ---------- Forwarded message ---------
> >> From: Sascha Hauer <s.hauer@pengutronix.de>
> >> Date: Thu, Mar 21, 2019 at 4:06 PM
> >> Subject: Re: selected processor does not support `rev r7,r7'
> >> To: Lewis Zhou <lewisou@gmail.com>
> >> Cc: <barebox@lists.infradead.org>
> >>
> >>
> >> On Thu, Mar 21, 2019 at 03:53:06PM +0800, Lewis Zhou wrote:
> >> > Hi Sascha,
> >> >
> >> > Here's the log:
> >> >
> >> > make -f scripts/Makefile.build obj=common
> >> >
> >> > arm-cortex_a8-linux-gnueabihf-gcc -Wp,-MD,common/.memory.o.d
> >> > -nostdinc -isystem
> >> >
> /home/lewis/x-tools/arm-cortex_a8-linux-gnueabihf/lib/gcc/arm-cortex_a8-linux-gnueabihf/8.3.0/include
> >> > -D__KERNEL__ -D__BAREBOX__ -Iinclude
> >> > -I/home/lewis/OpenProj/barebox/dts/include
> >> > -I/home/lewis/OpenProj/barebox/arch/arm/include
> >> > -I/home/lewis/OpenProj/barebox/arch/arm/include -include
> >> > /home/lewis/OpenProj/barebox/include/linux/kconfig.h -fno-builtin
> >> > -ffreestanding -D__ARM__ -fno-strict-aliasing -marm -mlittle-endian
> >> > -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=7
> >> > -march=armv5t -Wa,-march=armv7-a  -msoft-float -mthumb
> >>
> >> -march=armv5t -Wa,-march=armv7-a shouldn't be here. It comes from this
> >> line in arch/arm/Makefile:
> >>
> >> arch-$(CONFIG_CPU_32v7)         :=-D__LINUX_ARM_ARCH__=7 $(call
> >> cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
> >>
> >> This means the build process will use "-march=armv7-a" when the compiler
> >> supports it. Apparently it does not, so it will fall back to
> >> "-march=armv5t -Wa,-march=armv7-a". armv5t doesn't support thumb2 code,
> >> only thumb and as it seems thumb does not support the "rev" instruction.
> >>
> >> Your compiler should really support "-march=armv7-a". If it doesn't I
> >> really think there is something wrong with it.
> >>
> >> Sascha
> >>
> >> --
> >> Pengutronix e.K.                           |
>  |
> >> Industrial Linux Solutions                 | http://www.pengutronix.de/
> |
> >> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0
>   |
> >> Amtsgericht Hildesheim, HRA 2686           | Fax:
>  +49-5121-206917-5555 |
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: selected processor does not support `rev r7,r7'
       [not found]                 ` <CAD_Pvua_tQ2qe2297bfGvS2ekDz2_StM4WbhiBy=yLVVHokS-A@mail.gmail.com>
@ 2019-03-22  4:01                   ` Austin Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Austin Morton @ 2019-03-22  4:01 UTC (permalink / raw)
  To: Lewis Zhou; +Cc: crossgcc maillist, Sascha Hauer

You are correct, that is the root of the issue.

Can you add -v to that gcc invocation and post the output?

On Thu, Mar 21, 2019, 23:58 Lewis Zhou <lewisou@gmail.com> wrote:

> Hi,
>
> I am pretty sure the root cause is this:
> ~/OpenProj/linux-beagleboard/scripts$  arm-cortex_a8-linux-gnueabihf
> -Werror -march=armv7-a -c -x c /dev/null -o "$$TMP"
> cc1: error: -mfloat-abi=hard: selected processor lacks an FPU
>
> Why does the arm-cortex_a8-linux-gnueabihf toolchain built by ct-ng
> emit this error? Which make the Kbuild believe the CC not support
> armv7-a!
>
>
> Kind regards,
> Lewis
>
> On Fri, Mar 22, 2019 at 11:30 AM Lewis Zhou <lewisou@gmail.com> wrote:
> >
> > Hi,
> >
> > I was using  arm-cortex_a8-linux-gnueabihf built by ct-ng to compile
> > Linux-4.19 and got a stranger cc-option  -march=armv5t
> > -Wa,-march=armv7-a which is believed to cause the make failure.
> >
> > After some investigations, I guess that a line in the
> > ./arch/arm/Makefile below generated the strange cc-option:
> >
> > arch-$(CONFIG_CPU_32v7)   =-D__LINUX_ARM_ARCH__=7 $(call
> > cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
> >
> > But I have no idea why. I have tried the arm-linux-gnueabihf package
> > on Ubuntu, that works ok.
> >
> > Kind regards,
> > Lewis
> >
> > On Thu, Mar 21, 2019 at 4:40 PM Austin Morton <austinpmorton@gmail.com>
> wrote:
> > >
> > > Any recent version of gcc should spit out a list of supported March
> values if invoked with an invalid value. (read gcc 7 or higher).
> > >
> > > What does this command output on your compiler?
> > >
> > > # gcc -E -march=help -xc /dev/null
> > >
> > >
> https://stackoverflow.com/questions/47299458/how-can-i-determine-what-architectures-gcc-supports
> > >
> > > On Thu, Mar 21, 2019, 04:25 Lewis Zhou <lewisou@gmail.com> wrote:
> > >>
> > >> Hi,
> > >>
> > >> I recently tried to compile the barebox bootloaer with the
> > >> arm-cortex_a8-linux-gnueabihf configuration which is based on the
> > >> sample configuration arm-cortex_a8-linux-gnueabi with the hardware
> > >> float enabled.
> > >>
> > >> However, the compiler (gcc) seems not support -march=armv7-a flag. I
> > >> think something is wrong as the cortex_a8 is a sub-architecture of
> > >> armv7-a.
> > >>
> > >> The toolchain failed to compile both the barebox and the linux kernel
> > >> (4.19). Please help! Attached is a response from the barebox mailing
> > >> list.
> > >>
> > >>
> > >> Kind regards,
> > >> Lewis
> > >>
> > >> ---------- Forwarded message ---------
> > >> From: Sascha Hauer <s.hauer@pengutronix.de>
> > >> Date: Thu, Mar 21, 2019 at 4:06 PM
> > >> Subject: Re: selected processor does not support `rev r7,r7'
> > >> To: Lewis Zhou <lewisou@gmail.com>
> > >> Cc: <barebox@lists.infradead.org>
> > >>
> > >>
> > >> On Thu, Mar 21, 2019 at 03:53:06PM +0800, Lewis Zhou wrote:
> > >> > Hi Sascha,
> > >> >
> > >> > Here's the log:
> > >> >
> > >> > make -f scripts/Makefile.build obj=common
> > >> >
> > >> > arm-cortex_a8-linux-gnueabihf-gcc -Wp,-MD,common/.memory.o.d
> > >> > -nostdinc -isystem
> > >> >
> /home/lewis/x-tools/arm-cortex_a8-linux-gnueabihf/lib/gcc/arm-cortex_a8-linux-gnueabihf/8.3.0/include
> > >> > -D__KERNEL__ -D__BAREBOX__ -Iinclude
> > >> > -I/home/lewis/OpenProj/barebox/dts/include
> > >> > -I/home/lewis/OpenProj/barebox/arch/arm/include
> > >> > -I/home/lewis/OpenProj/barebox/arch/arm/include -include
> > >> > /home/lewis/OpenProj/barebox/include/linux/kconfig.h -fno-builtin
> > >> > -ffreestanding -D__ARM__ -fno-strict-aliasing -marm -mlittle-endian
> > >> > -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=7
> > >> > -march=armv5t -Wa,-march=armv7-a  -msoft-float -mthumb
> > >>
> > >> -march=armv5t -Wa,-march=armv7-a shouldn't be here. It comes from this
> > >> line in arch/arm/Makefile:
> > >>
> > >> arch-$(CONFIG_CPU_32v7)         :=-D__LINUX_ARM_ARCH__=7 $(call
> > >> cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
> > >>
> > >> This means the build process will use "-march=armv7-a" when the
> compiler
> > >> supports it. Apparently it does not, so it will fall back to
> > >> "-march=armv5t -Wa,-march=armv7-a". armv5t doesn't support thumb2
> code,
> > >> only thumb and as it seems thumb does not support the "rev"
> instruction.
> > >>
> > >> Your compiler should really support "-march=armv7-a". If it doesn't I
> > >> really think there is something wrong with it.
> > >>
> > >> Sascha
> > >>
> > >> --
> > >> Pengutronix e.K.                           |
>    |
> > >> Industrial Linux Solutions                 |
> http://www.pengutronix.de/  |
> > >> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone:
> +49-5121-206917-0    |
> > >> Amtsgericht Hildesheim, HRA 2686           | Fax:
>  +49-5121-206917-5555 |
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-22  4:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAD_Pvub19JJgwwkZrNX7iz47f-jib5hiUgE+8Z=2cSf80=YygQ@mail.gmail.com>
     [not found] ` <20190320075215.7j36mofzoewd5qfa@pengutronix.de>
     [not found]   ` <CAD_PvuYxnQJT7VVe0DKRZa-VHJN+Rz-tb9KLudtd+My8CBXhLg@mail.gmail.com>
     [not found]     ` <20190321073332.b3725avve4p6ascg@pengutronix.de>
     [not found]       ` <CAD_PvubAaFD=zJVrzpjq__F2Qre4XedjE8op_1GAQcf19jYOrg@mail.gmail.com>
     [not found]         ` <20190321080614.jmpycfyetz4rugui@pengutronix.de>
2019-03-21  8:24           ` Fwd: selected processor does not support `rev r7,r7' Lewis Zhou
2019-03-21  8:40             ` Austin Morton
     [not found]               ` <CAD_PvuaROBDHod3XjFFgZ6Qic3pHhRSP=qFbQ5MHwGJs=js+0g@mail.gmail.com>
2019-03-21  9:15                 ` Austin Morton
     [not found]               ` <CAD_Pvub+CwCM_ys72JiQ9jgQ_Gz=+qdsz7o2MK-6nV7icfSzZQ@mail.gmail.com>
     [not found]                 ` <CAD_Pvua_tQ2qe2297bfGvS2ekDz2_StM4WbhiBy=yLVVHokS-A@mail.gmail.com>
2019-03-22  4:01                   ` Austin Morton

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 read-only IMAP folder(s) and NNTP newsgroup(s).