arch: arm: Remove -march compiler flag

The ARM GCC `-march` compiler flag is completely redundant when the
`-mcpu` flag is specified, since the `-mcpu` selects the target ARM
architecture as well as CPU-specific optimisations.

In fact, it is disadvantageous to specify both `-march` and `-mcpu`
flags because the `-march` flag overrides and disables any CPU-specific
optimisations enabled by the `-mcpu` flag.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
Stephanos Ioannidis 2020-04-21 11:54:19 +09:00 committed by Ioannis Glaropoulos
commit 1d9b08aef5

View file

@ -14,22 +14,8 @@ else()
list(APPEND TOOLCHAIN_LD_FLAGS -mthumb)
endif()
set(ARCH_FOR_cortex-m0 armv6s-m )
set(ARCH_FOR_cortex-m0plus armv6s-m )
set(ARCH_FOR_cortex-m3 armv7-m )
set(ARCH_FOR_cortex-m4 armv7e-m )
set(ARCH_FOR_cortex-m23 armv8-m.base )
set(ARCH_FOR_cortex-m33 armv8-m.main+dsp)
set(ARCH_FOR_cortex-m33+nodsp armv8-m.main )
set(ARCH_FOR_cortex-r4 armv7-r )
set(ARCH_FOR_cortex-r5 armv7-r+idiv )
if(ARCH_FOR_${GCC_M_CPU})
set(ARCH_FLAG -march=${ARCH_FOR_${GCC_M_CPU}})
endif()
list(APPEND TOOLCHAIN_C_FLAGS -mabi=aapcs ${ARCH_FLAG})
list(APPEND TOOLCHAIN_LD_FLAGS -mabi=aapcs ${ARCH_FLAG})
list(APPEND TOOLCHAIN_C_FLAGS -mabi=aapcs)
list(APPEND TOOLCHAIN_LD_FLAGS -mabi=aapcs)
# Defines a mapping from GCC_M_CPU to FPU