[oe] [PATCH] cortex-m3: adjusted target cflags

Enrico Scholz enrico.scholz at sigma-chemnitz.de
Mon Feb 7 20:59:51 UTC 2011


Khem Raj <raj.khem at gmail.com> writes:

>> The '-mcpu=cortex-m3' is shorter than '-march=armv7-m -mtune=cortex-m3'
>> and enables workarounds like '-mfix-cortex-m3-ldrd'.
>
> Does -mcpu=cortex-m3 also cause gcc to tune for cortex-m3 ?

Yes; logic in gcc/config/arm/arm.c is:

|    if (i == ARM_OPT_SET_CPU || i == ARM_OPT_SET_TUNE)
|      arm_tune = (enum processor_type) (sel - ptr->processors);
|
|    if (i == ARM_OPT_SET_ARCH)
|      target_arch_cpu = sel->core;
|
|    if (i == ARM_OPT_SET_CPU)
|      selected_cpu = (enum processor_type) (sel - ptr->processors);

'-mcpu' causes the highest optimization level (both for the used instruction
set (--> '-march') and the "soft" optimizations (--> '-mcpu')).



Enrico




More information about the Openembedded-devel mailing list