Miosix Toolchain: Difference between revisions

From Miosix Wiki
Jump to navigation Jump to search
No edit summary
Update after the release of Miosix 3
 
(31 intermediate revisions by one other user not shown)
Line 1: Line 1:
== Information on the Miosix Toolchain ==
The Miosix Toolchain is a patched version of the [https://gcc.gnu.org GCC] compiler, [https://www.sourceware.org/newlib Newlib] C library, and libstdc++ library. The [https://github.com/fedetft/miosix-kernel/tree/master/miosix/_tools/compiler patches] to the compiler and standard libraries are required to:
* Provide thread safety. Cooperation between the compiler and kernel is needed to make certain C/C++ standard library functions and certain C++ language constructs thread safe.
* Implement the memory model for Miosix processes and support the fluid kernel design of Miosix (-qkernelspace option to switch between compiling for the kernel or processes)
* Improved speed of the pthread and C++ thread APIs.
* Code size and RAM requirement reductions.
Some of the patches have been contributed upstream, but to date compiling Miosix still requires patches. Patches are updated from time to time, and users are required to upgrade to the latest version of the compiler when necessary. The build system will warn you when it's time to upgrade the compiler.


== Latest version of the Miosix Toolchain ==
== Latest version of the Miosix Toolchain ==


You can download the latest version of the Miosix Toolchain here
=== Release GCC 15.2.0mp4.2 ===
* [http://miosix.org/toolchain/MiosixToolchainInstaller.run Miosix Toolchain Linux] This is self-installing shell script, run ii with
 
<source lang="bash">sh MiosixToolchainInstaller.run</source>
Released '''March 25th, 2026'''. This version:
* [http://miosix.org/toolchain/MiosixToolchainInstaller.exe Miosix Toolchain Windows] This is a self-installing .exe
* is '''required''' to compile Miosix v2.99 and higher. Compiling older kernels (v2.81 and lower) '''no longer supported''', you'll still need the 9.2.0 release for that.
Both versions will automatically detect a previous version of the compiler and uninstall it, unless you are on Linux and you have installed the toolchain from sources. In such a case you should uninstall it manually using the ''uninstall.sh'' file in the ''miosix/_tools/compiler'' directory of the kernel git repository.
* provides C++23 support
* provides OpenMP support to allow parallelization of algorithms when targeting multicore microcontrollers
* GCC upgraded to 15.2.0


== Information on the Miosix Toolchain ==
_MIOSIX_GCC_PATCH_MAJOR is set to 4, and _MIOSIX_GCC_PATCH_MINOR is set to 2 in this release.
 
* [https://miosix.org/toolchain/MiosixToolchainInstaller15.2.0mp4.2.run Miosix Toolchain Linux] (sha256sum 51cf6cb78f2a04341db0d17869bd2074d6c63332612269a4edc8fb4c7469e2dd) This is self-installing shell script, run it with
<source lang="bash">sh MiosixToolchainInstaller15.2.0mp4.2.run</source>
* [https://miosix.org/toolchain/MiosixToolchainInstaller15.2.0mp4.2.exe Miosix Toolchain Windows] (sha256sum c67158aa2efb5275e4c460289e7e7514bf57c3dc3ec93161ae32d22d511b269f) This is a self-installing .exe
* [https://miosix.org/toolchain/MiosixToolchainInstaller15.2.0mp4.2_Intel.pkg Miosix Toolchain Mac OS (Intel)] (sha256sum 59b000631bb69b44f4846653cb3671997a38476c5e67295ade6417344296d7be) Contributed by Daniele Cattaneo, it is a release build of the Miosix toolchain for Mac OS (Intel).
* [https://miosix.org/toolchain/MiosixToolchainInstaller15.2.0mp4.2_ARM.pkg Miosix Toolchain Mac OS (ARM)] (sha256sum 95a847bbd7991e285a26b3559bca5be33997ca64bf1e9ed71bab5c1dca08650f) Contributed by Daniele Cattaneo, it is a release build of the Miosix toolchain for Mac OS (ARM).
 
As an alternative to installing a binary release, you can build this toolchain from [https://github.com/fedetft/miosix-kernel/tree/unstable/tools/compiler/gcc-15.2.0-mp4.2 sources].
 
== Previous versions of the Miosix Toolchain ==
 
=== Release GCC 9.2.0mp3.2 ===
 
Released '''July 29th, 2024'''. This version:
* speed improvements in newlib ''fread'' function (up to 70% faster)
* support for more architectures (Cortex-M0+ and Cortex-M4 variant without FPU)
* GCC kept at version 9.2.0
 
_MIOSIX_GCC_PATCH_MAJOR is set to 3, and _MIOSIX_GCC_PATCH_MINOR is set to '''2''' in this release.
 
* [https://miosix.org/toolchain/MiosixToolchainInstaller9.2.0mp3.2.run Miosix Toolchain Linux] (sha256sum d71fdac28a6fc4a4c0b41e90fb46c3722805b04e1ddb355d0da2f1b67e50ef3e) This is self-installing shell script, run it with
<source lang="bash">sh MiosixToolchainInstaller9.2.0mp3.2.run</source>
* [https://miosix.org/toolchain/MiosixToolchainInstaller9.2.0mp3.2.exe Miosix Toolchain Windows] (sha256sum 4182788ccb27e42cd56afe65c7146c601aadcab0b758c9882e4a3cf394c6f622) This is a self-installing .exe
* [https://miosix.org/toolchain/MiosixToolchainInstaller9.2.0mp3.2_Intel.pkg Miosix Toolchain Mac OS (Intel)] (sha256sum 5420a4fdb7aee9337350a77bde4820d983d41c7e193cc7bc90612a58287c6010) Contributed by Daniele Cattaneo, it is a release build of the Miosix toolchain for Mac OS (Intel).
* [https://miosix.org/toolchain/MiosixToolchainInstaller9.2.0mp3.2_ARM.pkg Miosix Toolchain Mac OS (ARM)] (sha256sum dca08d3aff33b06b5b848ca07d5f7d95a17a8ae0bde53f0a6e8fca4f181d4f16) Contributed by Daniele Cattaneo, it is a release build of the Miosix toolchain for Mac OS (ARM).
 
As an alternative to installing a binary release, you can build this toolchain from [https://github.com/fedetft/miosix-kernel/tree/master/miosix/_tools/compiler/gcc-9.2.0-mp3.2 sources].
 
=== Release GCC 9.2.0mp3.1 ===
 
Released '''August 12th, 2020'''. This version:
* upgrades GCC to 9.2.0
* supports the C++11 thread API in Miosix (before only the POSIX one was supported)
* supports C++14
* reduces code size of printf-related functions
* provides many improvements and bug fixes to Miosix userspace processes
* provides more comprehensive atomic operation support through GCC's libatomic
 
_MIOSIX_GCC_PATCH_MAJOR is set to 3, and _MIOSIX_GCC_PATCH_MINOR is set to 1 in this release.
 
No longer supported, if you need it you will have to rebuild this toolchain from [https://github.com/fedetft/miosix-kernel/tree/6fd0e3f09f9b7dd5eaca0bb98e6157cf8c8bde8d/miosix/_tools/compiler/gcc-9.2.0-mp3.1 sources].


The Miosix Toolchain is a specially patched version of the [https://gcc.gnu.org GCC] compiler, [https://www.sourceware.org/newlib Newlib] C library, and libstdc++ library. The patches to the compiler and standard libraries are required to:
=== Release GCC 4.7.3mp1 ===


* Provide thread safety of the C and C++ libraries. A lot of potential race conditions that occur when GCC is built for an embedded platform (i.e: not to produce binaries for a mainstream OS such as Linux or Windows where thread safety issues are already dealt with) have been fixed, for exemple throwing C++ exception from more threads at the same time is now thread safe, constructors of static objects are now thread safe, accessing the same FILE * handle from more threads is now thread safe... This cannot be done by the compiler alone, nor by the kernel alone, cooperation of the two is required, and this is the number one reason for having patches.
Released '''June 8th, 2014'''. This version provides GCC 4.7.3.
* Improved speed of the pthread API. For example, pthread_mutex_t is no longer an opaque pointer type but the real struct containing the mutex implementation. This results in a 7x speed increase with respect to the previous pthread_mutex code.
* Some more code size and RAM requirement reductions, such as the redefinition of BUFSIZ from 1024 to 256 bytes which reduces the RAM used by the C stdio library.


Some of the patches, mainly those that increase performance and reduce code size in Newlib have also been contributed upstream, but to date compiling Miosix still requires patches.
_MIOSIX_GCC_PATCH_VERSION is set to 1 in this release.


In previous versions of the kernel, the user was required to download the compiler sources, patch it and compile it. Even though this was automated through a simple script, it took a long time to build the compiler, especially for older machines, and it was cumbersome to say the least to do it on Windows. Starting from Miosix 2.0, the compiler is also distributed as a self-installing precompiled package, for both Linux and Windows.
No longer supported, if you need it you will have to rebuild this toolchain from [https://github.com/fedetft/miosix-kernel/tree/master/miosix/_tools/compiler/gcc-4.7.3-mp1 sources].


Also, due to the effort to achieve more POSIX compliance in Miosix 2.0, the compiler patches are updated from time to time, and users are required to upgrade to the latest version of the compiler when necessary.
[[Category:Installation and Configuration]]

Latest revision as of 10:36, 23 April 2026

Information on the Miosix Toolchain

The Miosix Toolchain is a patched version of the GCC compiler, Newlib C library, and libstdc++ library. The patches to the compiler and standard libraries are required to:

  • Provide thread safety. Cooperation between the compiler and kernel is needed to make certain C/C++ standard library functions and certain C++ language constructs thread safe.
  • Implement the memory model for Miosix processes and support the fluid kernel design of Miosix (-qkernelspace option to switch between compiling for the kernel or processes)
  • Improved speed of the pthread and C++ thread APIs.
  • Code size and RAM requirement reductions.

Some of the patches have been contributed upstream, but to date compiling Miosix still requires patches. Patches are updated from time to time, and users are required to upgrade to the latest version of the compiler when necessary. The build system will warn you when it's time to upgrade the compiler.

Latest version of the Miosix Toolchain

Release GCC 15.2.0mp4.2

Released March 25th, 2026. This version:

  • is required to compile Miosix v2.99 and higher. Compiling older kernels (v2.81 and lower) no longer supported, you'll still need the 9.2.0 release for that.
  • provides C++23 support
  • provides OpenMP support to allow parallelization of algorithms when targeting multicore microcontrollers
  • GCC upgraded to 15.2.0

_MIOSIX_GCC_PATCH_MAJOR is set to 4, and _MIOSIX_GCC_PATCH_MINOR is set to 2 in this release.

  • Miosix Toolchain Linux (sha256sum 51cf6cb78f2a04341db0d17869bd2074d6c63332612269a4edc8fb4c7469e2dd) This is self-installing shell script, run it with
sh MiosixToolchainInstaller15.2.0mp4.2.run
  • Miosix Toolchain Windows (sha256sum c67158aa2efb5275e4c460289e7e7514bf57c3dc3ec93161ae32d22d511b269f) This is a self-installing .exe
  • Miosix Toolchain Mac OS (Intel) (sha256sum 59b000631bb69b44f4846653cb3671997a38476c5e67295ade6417344296d7be) Contributed by Daniele Cattaneo, it is a release build of the Miosix toolchain for Mac OS (Intel).
  • Miosix Toolchain Mac OS (ARM) (sha256sum 95a847bbd7991e285a26b3559bca5be33997ca64bf1e9ed71bab5c1dca08650f) Contributed by Daniele Cattaneo, it is a release build of the Miosix toolchain for Mac OS (ARM).

As an alternative to installing a binary release, you can build this toolchain from sources.

Previous versions of the Miosix Toolchain

Release GCC 9.2.0mp3.2

Released July 29th, 2024. This version:

  • speed improvements in newlib fread function (up to 70% faster)
  • support for more architectures (Cortex-M0+ and Cortex-M4 variant without FPU)
  • GCC kept at version 9.2.0

_MIOSIX_GCC_PATCH_MAJOR is set to 3, and _MIOSIX_GCC_PATCH_MINOR is set to 2 in this release.

  • Miosix Toolchain Linux (sha256sum d71fdac28a6fc4a4c0b41e90fb46c3722805b04e1ddb355d0da2f1b67e50ef3e) This is self-installing shell script, run it with
sh MiosixToolchainInstaller9.2.0mp3.2.run
  • Miosix Toolchain Windows (sha256sum 4182788ccb27e42cd56afe65c7146c601aadcab0b758c9882e4a3cf394c6f622) This is a self-installing .exe
  • Miosix Toolchain Mac OS (Intel) (sha256sum 5420a4fdb7aee9337350a77bde4820d983d41c7e193cc7bc90612a58287c6010) Contributed by Daniele Cattaneo, it is a release build of the Miosix toolchain for Mac OS (Intel).
  • Miosix Toolchain Mac OS (ARM) (sha256sum dca08d3aff33b06b5b848ca07d5f7d95a17a8ae0bde53f0a6e8fca4f181d4f16) Contributed by Daniele Cattaneo, it is a release build of the Miosix toolchain for Mac OS (ARM).

As an alternative to installing a binary release, you can build this toolchain from sources.

Release GCC 9.2.0mp3.1

Released August 12th, 2020. This version:

  • upgrades GCC to 9.2.0
  • supports the C++11 thread API in Miosix (before only the POSIX one was supported)
  • supports C++14
  • reduces code size of printf-related functions
  • provides many improvements and bug fixes to Miosix userspace processes
  • provides more comprehensive atomic operation support through GCC's libatomic

_MIOSIX_GCC_PATCH_MAJOR is set to 3, and _MIOSIX_GCC_PATCH_MINOR is set to 1 in this release.

No longer supported, if you need it you will have to rebuild this toolchain from sources.

Release GCC 4.7.3mp1

Released June 8th, 2014. This version provides GCC 4.7.3.

_MIOSIX_GCC_PATCH_VERSION is set to 1 in this release.

No longer supported, if you need it you will have to rebuild this toolchain from sources.