2026-01-07 11:46 PM
Hi!
Was hit by a non-obvious difference between the ARM and ST GCC toolchains.
I installed the following toolchains (from the official ARM and ST websites) in two separate Docker containers.
Their --version outputs are:
ST toolchain
ARM toolchain
Then I compiled a simple main.c using the cyclomatic complexity option:
Results:
ARM GCC 13 reports:
ST GCC 13 accepts the option without any error.
So even though both toolchains report the same GCC version, the ST build includes this option while the ARM reference toolchain does not.
This suggests that there may be additional differences between the two toolchains.
When using both toolchains - or migrating from one to the other - be careful.
Just a heads-up.
2026-01-09 6:12 AM
Is there anywhere an official documentation from ST listing all the changes made by ST in their version of the toolchain? Would be interesting to know.
2026-01-10 3:18 AM
There exists an overview from the changes on ST's official GitHub repository for the GNU Toolchains with prepatched source code. Unfortunately the patches itself are missing. It also includes the build scripts.
https://github.com/STMicroelectronics/gnu-tools-for-stm32/tree/13.3.rel1
Here the extract for release 13.3rel1 from README.md:
Patch DescriptionPatches
Fix for long path issues on Windows Windows has a limit of the number of characters in paths to files. This fix allows up to 248 characters in paths to GCC toolchain binaries and up to 4096 characters for all files processed by the GCC tools. Without the patch the latter limit is about 150 characters. Provide Newlib string function compatible with all platforms Adds aliases for Newlib string functions. Enables the functions to be called on all target platforms without changing the target source code. Useful for unit testing of target source code on Windows. Provide compatibility with IAR EW projects Adds pre-processor symbol __FILE_NAME__ which is used in IAR EW. Will be required for import of IAR EW projects. Enable debugging of functions in target libraries libg or libg_nano Updates the GCC build scripts for libg and libg_nano in Newlib, so that debug symbols are not stripped. Correct stack usage for functions with inline assembler Required by Stack Analyzer advanced debug function in CubeIDE. Reduce Newlib code size by 10-30% Updates the GCC build scripts for Newlib to use -Os instead of -O2. Beneficial in most embedded projects. Prepare for calculation of cyclomatic complexity Provides the ability to calculate cyclomatic complexity of the target source code processed by GCC. The patch integrates the plugin into GCC binaries. Include librdimon-v2m.a in delivery for both Newlib variants Support rdimon on Cortex-A by including librdimon-v2m.a for the Newlib-nano.