Right CFLAGS/CXXFLAGS for Pyra ?


Linux-SWAT

Forum Addict!
Joined
Feb 13, 2010
Messages
9,175
Hi,

I'm using those parameters natively on the Pyra:
Code:
export CFLAGS=" -DCORTEX-A15 -O2 -pipe -march=armv7-a -mcpu=cortex-a15 -mfloat-abi=hard -mfpu=neon-vfpv4 -fPIC "
export CXXFLAGS=" -DCORTEX-A15 -O2 -pipe -march=armv7-a -mcpu=cortex-a15 -mfloat-abi=hard -mfpu=neon-vfpv4 -fPIC "

But I got this warning:
Code:
cc1: warning: switch ‘-mcpu=cortex-a15’ conflicts with switch ‘-march=armv7-a+neon-vfpv4’

So which flags are the right ones ?
 
Last edited:
maybe
-O2 -march=native
auto-selects nice values.
you can check them with
gcc -### -E - -O2 -march=native 2>&1 | sed -r '/cc1/!d;s/(")|(^.* - )//g'
 
i didn't have noted this before...because i allways used " -mcpu=cortex-a15 -mfloat-abi=hard -mfpu=neon-vfpv4" without -march
but a search on the web....https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57907
Richard Earnshaw 2013-07-23 16:23:26 UTC
You get the warning because Cortex-A15 implements a superset of ARM-v7a, due to the addition of the HW division instructions. This means that -march=armv7-a and -mcpu=cortex-a15 leads to an ambiguity as to what architectural features you want and hence the warning.

It's not currently possible to specify the exact architecture variant that A15 supports in the command line; we're looking at fixing that in future.

it's now fixed (but i've not tested on Pyra GCC yet ) using -march=armv7ve
 
Last edited:
Now I'm going to have to double check what I've been doing...

But -march=armv7ve seems familiar...
 
Right now, I'm using for most of my Slackware packages:
Code:
-O2 -pipe -march=native -mfloat-abi=hard -fPIC

I had
Code:
-ftree-vectorize -ffast-math
on Pandora, I wonder if I should also have them.
Post automatically merged:

maybe
-O2 -march=native
auto-selects nice values.
you can check them with
gcc -### -E - -O2 -march=native 2>&1 | sed -r '/cc1/!d;s/(")|(^.* - )//g'
Code:
$ gcc -### -E - -O2 -march=native 2>&1 | sed -r '/cc1/!d;s/(")|(^.* - )//g'
-mtune=generic-armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu -marm -mlibarch=armv7ve+simd -march=armv7ve+simd -O2 -dumpbase -

The -mfpu doesn't seem right according to:
https://embeddedartistry.com/blog/2017/10/11/demystifying-arm-floating-point-compiler-options
VFPv4
  • Built on VFPv3
  • Adds half-precision support as a storage format
  • Adds fused multiply-accumulate instructions
  • VFPv4-D32
    • 32 64-bit FPU registers
    • Implemented on the Cortex-A12 and A15 ARMv7 processors
    • Cortex-A7 optionally has VFPv4-D32 (in the case of an FPU with NEON)
 
Last edited:
  • Like
Reactions: rSl
I'll switch to:
Code:
-O2 -pipe -mcpu=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=hard -fPIC

https://gcc-help.gcc.gnu.narkive.com/aDnhe73f/mcpu-vs-march
-mcpu=cortex-a8 will perform specific optimisations for the Cortex-A8 such as
instruction scheduling and will produce better performing code on that core.
-march=armv7-a just selects the ARMv7-a architecture which tells the compiler
that it can use the instructions in ARMv7-a, but it will not perform any
core-specific performance tuning.

If you know that you'll be running your code on a Cortex-A8 you should specify
-mcpu=cortex-a8, it also automatically implies -march=armv7-a.

https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
‘armv7ve’
The extended version of the ARMv7-A architecture with support for virtualization.

Code:
$ gcc -### -E - -O2 -pipe -mcpu=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=hard -fPIC 2>&1 | sed -r '/cc1/!d;s/(")|(^.* - )//g'
-mcpu=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=hard -mtls-dialect=gnu -marm -mlibarch=armv7ve+simd -march=armv7ve+simd -fPIC -O2 -dumpbase -
 
Last edited:
Back
Top