Skip to content

STMicroelectronics/gnu-tools-for-stm32

Repository files navigation

GNU Tools for STM32

This repository contains sources and build scripts for GNU Tools for STM32 C/C++ bare-metal toolchain included into STM32CubeIDE advanced development platform and part of the STM32Cube software ecosystem. It is based on ARM GNU Toolchain sources, with patches improving use in embedded systems.

Components

  • GNU C/C++ Compiler (GCC) - Upstream source code repository
  • GNU Binutils - Upstream source code repository
  • GDB - Upstream source code repository
  • Newlib - Upstream source code repository

License

See LICENSE.md

Host Platforms

  • GNU/Linux
  • Windows
  • macOs

Communication and support

For communication and support, please refer to:

Patches

Patch Description
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.
Enable user config of malloc() pagesize in Newlib Provides the ability to set the page size used when allocating memory in malloc(). Done by implementing sysconfig. Without the fix, the default page size is 4 Kbyte which may consume a lot memory in some applications. Applies to the build of the C standard library Newlib.
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.
Added -nostdlibc++ Added flag to disable linkage of libstdc++.
Honor limit for backwards threader Backported patch to properly handle backwards threader limitation. This reduces the code size with -Os for certain input constructions.
Security fix for CVE-2024-0151 Backported patches for CVE-2024-0151 that do proper zero/sign extend for non-secure callable functions with arguments/return value that are less than 32-bit.