Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compiler flag mismatch between project and target level [solved]
#3
Sure!

- Create a new project for the STM32H743VI (debugger output: EB monitor; HAL not used)
- Go to Project -> Build options... -> Project settings -> C - Flags -> Check Optimization disabled [-O0]
- Click OK than save project

After I build both targets the build log clearly shows that there is two optimisation flags for the release target. It seems that the -O2 flag overrides the -O0 flag.

<b>-------------- Build: Debug in CompilerFlags ---------------</b><br />
arm-none-eabi-gcc.exe -mcpu=cortex-m7  -mthumb -mfpu=fpv5-d16 -D__HEAP_SIZE=0x0000 -D__STACK_SIZE=0x0100 -mfloat-abi=hard -O0 -fno-strict-aliasing -g2 -Wall -fdata-sections -ffunction-sections

<b>-------------- Build: Release in CompilerFlags ---------------</b><br />
arm-none-eabi-gcc.exe -mcpu=cortex-m7  -mthumb -mfpu=fpv5-d16 -D__HEAP_SIZE=0x0000 -D__STACK_SIZE=0x0100 -mfloat-abi=hard -O0 -fno-strict-aliasing -fdata-sections -ffunction-sections -O2 -g2

I've checked other flags and the problem is the same. For example, if the target contains the -g2 flag and than I set the -g1 flag in the project settings, in the build log I can see both the -g1 and -g2 flags.
And this is true for the 1.11 version also.

If I change the target policy to 'Use project options only', the problem has gone.

As you can see in the previously attached image the target checkboxes are greyed out and shows the project settings. But in the background the target settings doens't changed, and they still appended to the project settings.
Reply


Messages In This Thread
RE: Compiler flag mismatch between project and target level - by Operton - 29-10-2021, 12:36 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)