PowerPC compilation flags

Segher Boessenkool segher@kernel.crashing.org
Sun Nov 25 23:24:00 GMT 2018


Hi!

On Sun, Nov 25, 2018 at 05:36:38PM -0500, Felipe GM wrote:
> >On Sun, Nov 25, 2018 at 02:42:10PM -0500, Felipe GM wrote:
> >>Currently I am developing for a MPC5777 board, with e200z7 cores. Most
> >>of the things are going well, but I am stuck with a problem that is
> >>really annoying me already. I am trying to use floating point operations
> >>on portions of my code, using the embedded hardware support. My
> >>toolchain is GCC 6.3 (powerpc-gcc, although I have tried with 7.3 and
> >>8.2 too), for which I am using the following flags:
> >*GCC 6 is no longer maintained. GCC 8 powerpc*-* does not support SPE 
> >anymore (you need to configure for powerpc*-*spe* instead; you 
> >probably want that for GCC 6 and GCC 7 as well).*
> That is why I tried 7.3 and 8.2! Regarding powerpc-*-spe, do you mean to 
> use a different cross gcc? Or just different compilation flags?

It's easiest if you build for target powerpc-eabispe or whatever you have.
That will default -mspe etc.; and you may not even be able to switch it
on other configurations, at all.

> >>|ASFLAGS_BASE =-g -a32 -mbooke -me500 --fatal-warnings ARCH_FLAGS
> >>=-mpowerpc-gpopt -mfprnd -misel -m32 -mhard-float-mabi=spe -mmfpgpr
> >>-mfloat-gprs=single|
> >*-mpowerpc-gpopt, -mfprnd, -mmfpgpr, and -mhard-float do not make 
> >sense for your target.*
> I have used most of them in order to try to solve the issue. One 
> question here though. When I use -mspe (or something similar, depending 
> on the gcc version) flag, not always the floating point support is 
> provided. More than once the linker asked for the unimplemented 
> functions, similar to what I said before (__divdf3, etc).

Your CPU has hardware support for single precision only.  You get the
soft float support for double precision (like that __divdf3, yes --
anything "df").  This is what -mfloat-gprs=single does :-)

You always should link libgcc.  This is the default if you link using
gcc, but your custom linker scripts may have other plans ;-)


Segher



More information about the Gcc-help mailing list