Skip to main content
SKape
Associate II
November 28, 2023
Question

STM32CubeIDE 1.14.0 flto build warning

  • November 28, 2023
  • 16 replies
  • 10118 views

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?

    16 replies

    CsBe
    Explorer II
    April 30, 2024

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

    Visitor II
    July 2, 2024

    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
    Explorer II
    July 3, 2024

    Unfortunately still not fixed in v1.16.

    CsBe
    Explorer II
    September 24, 2024

    Version: 1.16.1 -- still not fixed

    Visitor II
    November 27, 2024

    Version: 1.17.0 -- still not fixed. How to get around this?

    CsBe
    Explorer II
    November 27, 2024

    just the internal builder (Properties --- C/C++ Build ---  Builder Settings ---- Builder Type = Internal B)

    Associate II
    November 21, 2025

    This works, thank you, but the internal builder is much slower, and builds take up to twice as long. This may be annoying for larger projects or developers with older CPUs. Make sure to go to the behavior tab and select unlimited jobs. For some reason I can't get the internal builder to use more than 10 threads.

    The core issue is with gnu make and is fixed in GCC 14. So I presume this will resolve itself when STM32CubeIDE upgrades to version 14 of the ARM GNU Toolchain.

     

    SKape
    SKapeAuthor
    Associate II
    January 7, 2025

    Could any ST employee write whether and if so when a solution to this problem is planned?

    Associate II
    March 11, 2026

    I've found the root cause of the issue, and it's with the autogenerated makefiles.

    Regardless of whether stack usage or cyclomatic complexity are enabled, the subdir.mk files that STM32CudeIDE generates ALWAYS generate 

    Core/Src/%.su Core/Src/%.cyclo:

    Even if those project options are disabled, these still get generated in the subdir.mk.

    So the fix should be simple, update the makefile generator to not generate these lines if the corresponding project settings are not set.

    Associate II
    March 14, 2026

    For now, add this pattern:

    Screenshot 2026-03-13 204401.png

    to the GNU gmake error parser.

    You can find this under Windows -> Preferences -> C/C++ -> Build -> Settings -> Error Parsers.

    Make sure that error parser is enabled for your project.

    gnu make will still emit this to console, but at least it won't show up on the UI.

    If you still want to see the warnings for .o files, modify the regex accordingly.