linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Building with gcc 4.6.4
@ 2014-01-28 12:01 Russell King - ARM Linux
  2014-01-28 14:38 ` Mikael Pettersson
  0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2014-01-28 12:01 UTC (permalink / raw)
  To: linux-arm-kernel

So, yesterday I built gcc 4.6.4 (mainline) for the autobuilder, and the
result is that every build failed with the same error:

scripts/mod/empty.c:1:0: error: FPA is unsupported in the AAPCS

This seems to be because linux-elf targets default to fpe3 in mainline
gcc, but specifying -mabi=aapcs-linux switches us into EABI mode where
the compiler errors out with the default FPU.

Hence, I believe we need this to ensure that a compatible VFP is
selected.  One can argue that building EABI ARMv4 with VFP is silly,
but it seems that's what the gcc folk have decided (rightly or
wrongly.)

Maybe this is a bug in mainline GCC - which begs the question why
(presumably, since no one has picked this up) Linaro's toolchain
has fixes but mainline GCC doesn't.

Comments?

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 23d5e3946589..08a9ef58d9c3 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -96,7 +96,7 @@ tune-$(CONFIG_CPU_V6K)		=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
 tune-y := $(tune-y)
 
 ifeq ($(CONFIG_AEABI),y)
-CFLAGS_ABI	:=-mabi=aapcs-linux -mno-thumb-interwork
+CFLAGS_ABI	:=-mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp
 else
 CFLAGS_ABI	:=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,)
 endif


-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

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

* Building with gcc 4.6.4
  2014-01-28 12:01 Building with gcc 4.6.4 Russell King - ARM Linux
@ 2014-01-28 14:38 ` Mikael Pettersson
  2014-01-28 15:06   ` Russell King - ARM Linux
  0 siblings, 1 reply; 4+ messages in thread
From: Mikael Pettersson @ 2014-01-28 14:38 UTC (permalink / raw)
  To: linux-arm-kernel

Russell King - ARM Linux writes:
 > So, yesterday I built gcc 4.6.4 (mainline) for the autobuilder, and the
 > result is that every build failed with the same error:
 > 
 > scripts/mod/empty.c:1:0: error: FPA is unsupported in the AAPCS
 > 
 > This seems to be because linux-elf targets default to fpe3 in mainline
 > gcc, but specifying -mabi=aapcs-linux switches us into EABI mode where
 > the compiler errors out with the default FPU.
 > 
 > Hence, I believe we need this to ensure that a compatible VFP is
 > selected.  One can argue that building EABI ARMv4 with VFP is silly,
 > but it seems that's what the gcc folk have decided (rightly or
 > wrongly.)
 > 
 > Maybe this is a bug in mainline GCC - which begs the question why
 > (presumably, since no one has picked this up) Linaro's toolchain
 > has fixes but mainline GCC doesn't.
 > 
 > Comments?

Perhaps because most ARM EABI toolchains default to soft-float,
and the hardfloat ones usually select v6 or v7 + vfp-d16 or neon
as their defaults, so the archaic FPA is never the default.

Or are you using an OABI toolchain to compile an EABI kernel?

/Mikael

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

* Building with gcc 4.6.4
  2014-01-28 14:38 ` Mikael Pettersson
@ 2014-01-28 15:06   ` Russell King - ARM Linux
  2014-01-29 12:34     ` Mikael Pettersson
  0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2014-01-28 15:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 28, 2014 at 03:38:14PM +0100, Mikael Pettersson wrote:
> Russell King - ARM Linux writes:
>  > So, yesterday I built gcc 4.6.4 (mainline) for the autobuilder, and the
>  > result is that every build failed with the same error:
>  > 
>  > scripts/mod/empty.c:1:0: error: FPA is unsupported in the AAPCS
>  > 
>  > This seems to be because linux-elf targets default to fpe3 in mainline
>  > gcc, but specifying -mabi=aapcs-linux switches us into EABI mode where
>  > the compiler errors out with the default FPU.
>  > 
>  > Hence, I believe we need this to ensure that a compatible VFP is
>  > selected.  One can argue that building EABI ARMv4 with VFP is silly,
>  > but it seems that's what the gcc folk have decided (rightly or
>  > wrongly.)
>  > 
>  > Maybe this is a bug in mainline GCC - which begs the question why
>  > (presumably, since no one has picked this up) Linaro's toolchain
>  > has fixes but mainline GCC doesn't.
>  > 
>  > Comments?
> 
> Perhaps because most ARM EABI toolchains default to soft-float,
> and the hardfloat ones usually select v6 or v7 + vfp-d16 or neon
> as their defaults, so the archaic FPA is never the default.

soft-float has nothing to do with it, because the kernel always passes
-msoft-float.

> Or are you using an OABI toolchain to compile an EABI kernel?

... which should make no difference what so ever since the kernel should
be passing the appropriate options.  That's why we pass -mabi=aapcs-linux
to the kernel.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

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

* Building with gcc 4.6.4
  2014-01-28 15:06   ` Russell King - ARM Linux
@ 2014-01-29 12:34     ` Mikael Pettersson
  0 siblings, 0 replies; 4+ messages in thread
From: Mikael Pettersson @ 2014-01-29 12:34 UTC (permalink / raw)
  To: linux-arm-kernel

Russell King - ARM Linux writes:
 > On Tue, Jan 28, 2014 at 03:38:14PM +0100, Mikael Pettersson wrote:
 > > Russell King - ARM Linux writes:
 > >  > So, yesterday I built gcc 4.6.4 (mainline) for the autobuilder, and the
 > >  > result is that every build failed with the same error:
 > >  > 
 > >  > scripts/mod/empty.c:1:0: error: FPA is unsupported in the AAPCS
 > >  > 
 > >  > This seems to be because linux-elf targets default to fpe3 in mainline
 > >  > gcc, but specifying -mabi=aapcs-linux switches us into EABI mode where
 > >  > the compiler errors out with the default FPU.
 > >  > 
 > >  > Hence, I believe we need this to ensure that a compatible VFP is
 > >  > selected.  One can argue that building EABI ARMv4 with VFP is silly,
 > >  > but it seems that's what the gcc folk have decided (rightly or
 > >  > wrongly.)
 > >  > 
 > >  > Maybe this is a bug in mainline GCC - which begs the question why
 > >  > (presumably, since no one has picked this up) Linaro's toolchain
 > >  > has fixes but mainline GCC doesn't.
 > >  > 
 > >  > Comments?
 > > 
 > > Perhaps because most ARM EABI toolchains default to soft-float,
 > > and the hardfloat ones usually select v6 or v7 + vfp-d16 or neon
 > > as their defaults, so the archaic FPA is never the default.
 > 
 > soft-float has nothing to do with it, because the kernel always passes
 > -msoft-float.
 > 
 > > Or are you using an OABI toolchain to compile an EABI kernel?
 > 
 > ... which should make no difference what so ever since the kernel should
 > be passing the appropriate options.  That's why we pass -mabi=aapcs-linux
 > to the kernel.

I can reproduce your error with an OABI toolchain (gcc-4.6.4 or 4.7.3,
default configuration options wrt ISA and floating-point model), but
there's no such error with an EABI toolchain.  So it looks like you've
found a GCC bug.

However, the toolchain people considers OABI to be obsolete, it's
unsupported since gcc-4.7.0, gcc-4.6 is EOL, and even gcc-4.7 is
nearing EOL (will probably happen this spring or early summer after
the release of gcc-4.9.0), so I doubt anyone is going to work on
this issue.

/Mikael

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

end of thread, other threads:[~2014-01-29 12:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-28 12:01 Building with gcc 4.6.4 Russell King - ARM Linux
2014-01-28 14:38 ` Mikael Pettersson
2014-01-28 15:06   ` Russell King - ARM Linux
2014-01-29 12:34     ` Mikael Pettersson

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).