Upgrade to gcc 4.5.2
For quite a while it has been in the Miosix documentation the notice that building the kernel is only supported through a patched version of gcc. Every release since Miosix 1.50 contain the scripts to build the compiler in the 'miosix/compiler' folder. However, till Miosix 1.57 the patches were minimal, just a fix to reduce RAM usage, so it was effectively still possible to build the kernel with a normal gcc, such ase CodeSourcery's gcc.Starting with Miosix 1.58 things changed. The compiler scripts were upgraded to build gcc 4.5.2 and, more important, the patches are now more complex. This means that from Miosix 1.58 onwards the kernel will only compile with the new patched gcc 4.5.2. Even the previous patched gcc is no longer supported.
This has been done because the new patches provide some interesting features:
- Thread safety of the C and C++ library. A lot of potential race conditions 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 patched gcc.
- 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 512 bytes which reduces the RAM used by the C stdio library.