* Build failures with CC=arm-linux-gnueabihf-gcc-11
@ 2021-11-18 15:32 Ian Abbott
2021-11-19 9:29 ` Michael Olbrich
0 siblings, 1 reply; 3+ messages in thread
From: Ian Abbott @ 2021-11-18 15:32 UTC (permalink / raw)
To: barebox
Hi,
My Debian "testing" build system updated the default version of
arm-linux-gnueabihf-gcc from 10.x to 11.x. Building barebox in thumb-2
mode for an ARMv7 (it's a SoCFPGA) with this compiler fails with
assembler errors such as:
CC common/state/state_variables.o
{standard input}: Assembler messages:
{standard input}:1535: Error: selected processor does not support `rev
r3,r3' in Thumb mode
{standard input}:1576: Error: selected processor does not support `rev
r3,r3' in Thumb mode
Building in verbose mode (V=1) shows that "make" has selected the
compile flags `-march=armv5t -Wa,-march=armv7-a` instead of the usual
`-march=armv7-a`.
Looking a little deeper, all of the following lines in
"arch/arm/Makefile" are failing to select the first option and
defaulting to the second option (if any):
arch-$(CONFIG_CPU_64v8) := -D__LINUX_ARM_ARCH__=8 $(call
cc-option,-march=armv8-a)
arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call
cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call
cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call
cc-option,-march=armv5te,-march=armv4t)
The error from the compiler is:
cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
(Note: the error is only shown after tweaking the `try-run` command in
"scripts/Kbuild.include" so that it does not send error output to
"/dev/null".)
That error seems to be a change in behaviour between GCC 10.x and GCC 11.x.
At the point in the Makefile that the error occurs, the `-msoft-float`
option has not been added to `KBUILD_CPPFLAGS` yet. That is done further
down the Makefile except for `CONFIG_CPU_V8`. I guess it needs to be
added somewhere before problematic lines in the Makefile. I'm not sure
if `-msoft-float` is also needed for 64-bit ARMv8, but the error
suggests it is required there too.
--
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company )=-
-=( registered in England & Wales. Regd. number: 02862268. )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Build failures with CC=arm-linux-gnueabihf-gcc-11
2021-11-18 15:32 Build failures with CC=arm-linux-gnueabihf-gcc-11 Ian Abbott
@ 2021-11-19 9:29 ` Michael Olbrich
2021-11-19 10:30 ` Ian Abbott
0 siblings, 1 reply; 3+ messages in thread
From: Michael Olbrich @ 2021-11-19 9:29 UTC (permalink / raw)
To: Ian Abbott; +Cc: barebox
On Thu, Nov 18, 2021 at 03:32:04PM +0000, Ian Abbott wrote:
> Hi,
>
> My Debian "testing" build system updated the default version of
> arm-linux-gnueabihf-gcc from 10.x to 11.x. Building barebox in thumb-2 mode
> for an ARMv7 (it's a SoCFPGA) with this compiler fails with assembler errors
> such as:
>
> CC common/state/state_variables.o
> {standard input}: Assembler messages:
> {standard input}:1535: Error: selected processor does not support `rev
> r3,r3' in Thumb mode
> {standard input}:1576: Error: selected processor does not support `rev
> r3,r3' in Thumb mode
>
> Building in verbose mode (V=1) shows that "make" has selected the compile
> flags `-march=armv5t -Wa,-march=armv7-a` instead of the usual
> `-march=armv7-a`.
>
> Looking a little deeper, all of the following lines in "arch/arm/Makefile"
> are failing to select the first option and defaulting to the second option
> (if any):
It probably is added from here:
arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
The check for -march=armv7-a fails for some reason so the fallback is used.
I've seen this when CC is a wrapper and already adds -mcpu=... to the
commandline. In that case gcc now complains about the combination and the
check fails.
Michael
> arch-$(CONFIG_CPU_64v8) := -D__LINUX_ARM_ARCH__=8 $(call
> cc-option,-march=armv8-a)
> arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call
> cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
> arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call
> cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
> arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call
> cc-option,-march=armv5te,-march=armv4t)
>
> The error from the compiler is:
>
> cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
>
> (Note: the error is only shown after tweaking the `try-run` command in
> "scripts/Kbuild.include" so that it does not send error output to
> "/dev/null".)
>
> That error seems to be a change in behaviour between GCC 10.x and GCC 11.x.
>
> At the point in the Makefile that the error occurs, the `-msoft-float`
> option has not been added to `KBUILD_CPPFLAGS` yet. That is done further
> down the Makefile except for `CONFIG_CPU_V8`. I guess it needs to be added
> somewhere before problematic lines in the Makefile. I'm not sure if
> `-msoft-float` is also needed for 64-bit ARMv8, but the error suggests it is
> required there too.
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Build failures with CC=arm-linux-gnueabihf-gcc-11
2021-11-19 9:29 ` Michael Olbrich
@ 2021-11-19 10:30 ` Ian Abbott
0 siblings, 0 replies; 3+ messages in thread
From: Ian Abbott @ 2021-11-19 10:30 UTC (permalink / raw)
To: barebox
Hi Michael,
On 19/11/2021 09:29, Michael Olbrich wrote:
> On Thu, Nov 18, 2021 at 03:32:04PM +0000, Ian Abbott wrote:
>> Hi,
>>
>> My Debian "testing" build system updated the default version of
>> arm-linux-gnueabihf-gcc from 10.x to 11.x. Building barebox in thumb-2 mode
>> for an ARMv7 (it's a SoCFPGA) with this compiler fails with assembler errors
>> such as:
>>
>> CC common/state/state_variables.o
>> {standard input}: Assembler messages:
>> {standard input}:1535: Error: selected processor does not support `rev
>> r3,r3' in Thumb mode
>> {standard input}:1576: Error: selected processor does not support `rev
>> r3,r3' in Thumb mode
>>
>> Building in verbose mode (V=1) shows that "make" has selected the compile
>> flags `-march=armv5t -Wa,-march=armv7-a` instead of the usual
>> `-march=armv7-a`.
>>
>> Looking a little deeper, all of the following lines in "arch/arm/Makefile"
>> are failing to select the first option and defaulting to the second option
>> (if any):
>
> It probably is added from here:
>
> arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
>
> The check for -march=armv7-a fails for some reason so the fallback is used.
Yes, I showed the exact failure resulting from the cc-option call
further down my email:
cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
> I've seen this when CC is a wrapper and already adds -mcpu=... to the
> commandline. In that case gcc now complains about the combination and the
> check fails.
In my case, CC was set by this "build.sh" script:
#! /bin/sh
SRC="../barebox-de0-nano-soc"
ARCH="arm"
CROSS_COMPILE=arm-linux-gnueabihf-
CC='$(CROSS_COMPILE)gcc-11'
make -C "$SRC" O=`pwd` ARCH="$ARCH" CROSS_COMPILE="$CROSS_COMPILE"
CC="$CC" $*
so after expansion, CC=arm-linux-gnueabihf-gcc-11
>
> Michael
Cheers, Ian.
>
>> arch-$(CONFIG_CPU_64v8) := -D__LINUX_ARM_ARCH__=8 $(call
>> cc-option,-march=armv8-a)
>> arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call
>> cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
>> arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call
>> cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
>> arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call
>> cc-option,-march=armv5te,-march=armv4t)
>>
>> The error from the compiler is:
>>
>> cc1: error: ‘-mfloat-abi=hard’: selected architecture lacks an FPU
>>
>> (Note: the error is only shown after tweaking the `try-run` command in
>> "scripts/Kbuild.include" so that it does not send error output to
>> "/dev/null".)
>>
>> That error seems to be a change in behaviour between GCC 10.x and GCC 11.x.
>>
>> At the point in the Makefile that the error occurs, the `-msoft-float`
>> option has not been added to `KBUILD_CPPFLAGS` yet. That is done further
>> down the Makefile except for `CONFIG_CPU_V8`. I guess it needs to be added
>> somewhere before problematic lines in the Makefile. I'm not sure if
>> `-msoft-float` is also needed for 64-bit ARMv8, but the error suggests it is
>> required there too.
>
--
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company )=-
-=( registered in England & Wales. Regd. number: 02862268. )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-19 10:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 15:32 Build failures with CC=arm-linux-gnueabihf-gcc-11 Ian Abbott
2021-11-19 9:29 ` Michael Olbrich
2021-11-19 10:30 ` Ian Abbott
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox