cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE 1.14.0 flto build warning

SKape
Associate II

Hello. I have the following problem. When I enable flto optimization in a (freshly generated) project, several dozen warnings appear during compilation.

Sample warnings:

Drivers/STM32L4xx_HAL_Driver/Src/subdir.mk:88: warning: pattern recipe did not update peer target 'Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.su'.

Drivers/STM32L4xx_HAL_Driver/Src/subdir.mk:88: warning: pattern recipe did not update peer target 'Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.cyclo'.

This problem was not present on the previous version 1.13.2

How to solve this problem?

19 REPLIES 19

Try the internal builder until a better fix is available.

 

CsBe
Associate II

The warning still exists with STM32CubeIDE 1.15.0.

The current plan is that in the next release of GNU make, this will become an error not a warning. So you should address it now. The reason for the change is that there are other errors in how GNU make handles patterns that cannot be fixed without changing this.

The problem is this rule:

%-seq %-par :: %.cpp force
        $(MAKE) do_complicated_stuff src=$< TGT=$@

I'm not sure what you intend for this rule to actually do, but what it tells make it will do is a single invocation of this recipe will create both targets %-seq and %-par. That's what multiple patterns in a single rule means, and has always meant.

If your recipe does not actually build both of those targets then you will see this issue.

The simplest thing to do is write the rule twice, once for each target, which will work on all versions of GNU make and was always the correct way to write it:

%-seq :: %.cpp force
        $(MAKE) do_complicated_stuff src=$< TGT=$@
%-par :: %.cpp force
        $(MAKE) do_complicated_stuff src=$< TGT=$@

 

codebuk
Associate III

Hey ST this is still in 1.15.1. Do you plan to fix this or should I look at workarounds? 

Pavel A.
Evangelist III

https://www.gnu.org/software/make/manual/html_node/Pattern-Intro.html

"Pattern rules may have more than one target; however, every target must contain a % character. Multiple target patterns in pattern rules are always treated as grouped targets (see Multiple Targets in a Rule) regardless of whether they use the : or &: separator.

There is one exception: if a pattern target is out of date or does not exist and the makefile does not need to build it, then it will not cause the other targets to be considered out of date. Note that this historical exception will be removed in future versions of GNU make and should not be relied on. If this situation is detected make will generate a warning pattern recipe did not update peer target; however, make cannot detect all such situations. Please be sure that your recipe updates all the target patterns when it runs."

 

codebuk
Associate III

Hi Pavel,

Are you suggesting I can make a change to fix the error or is your comment for ST? 

Dan

 

 

 

 

 

 

CsBe
Associate II

The issue has already been reported and it should be addressed with the CubeIDE 1.16 release.

Comment for ST.

Have you tried to switch to internal builder and get rid of these makefiles altogether?

Yes, there is no warning but with internal builder is the flash usage 5% bigger. 

Sadly, seems not, just tried. 

Only fix so far was enabling creation of cyclomatic complexity info (the .cyclo file that the make rule declares that wants to build without actually doing that unless the option is checked).

 

STM should really open source the toolchain, cant' keep up with itself.

 

 

 

CsBe
Associate II

Unfortunately still not fixed in v1.16.