MQX includes project files for several IDEs, including Kinetis Design Studio (KDS). It is relatively simple to replace the GNU toolchain in KDS with another (similar) GNU toolchain. Understandably, some minor adjustments might be required to make a project build correctly with the new toolchain, but the MQX projects seem to be particularly dependent on the directory layout used in KDS. My question is whether that is necessary? I'm using version 4.2 of MQX.
I'm referring to the use of -nodefaultlibs and -nostdinc combined with the explicit specification of paths to the standard headers and libraries that ship with the toolchain.
Unless -nodefaultlibs and -nostdinc are specified, GCC will automatically look in the relevant directories for includes and libraries. As far as I can tell, passing -nodefaultlibs and -nostdinc and then explicitly adding these default include/library paths again has almost no impact on the behaviour of GCC, compared to its default behaviour.
I say almost, because it has two crucial impacts:
Based on this, I'm asserting that the purpose of the -nodefaultlibs and -nostdinc options is to allow users to completely disable the includes and libraries that ship with the GNU toolchain, and replace them with another set of includes/libraries in a different location. To use these options and then specify the same set of includes/libraries that they've just disabled seems bizarre. My question is: why are the MQX projects set up in this manner?
Hi Joe,
MQX RTOS contains its own STDIO libraries and ignores the GCC libraries. This is because MQX RTOS is
thread-safe.This ensures all library code will run correctly during simultaneous execution by multiple threads. All processes can access shared data and multiple instances of library functions without the risk of undefined behaviour.
I hope this helps,
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Sol,
Thanks for the reply, but it doesn't really answer my question:
Why do the KDS MQX projects seem to be setup to ignore the GCC libraries (as you say), but then add them back again in a less portable way (as explicit include and library paths). In essence the projects don't seem to ignore the libraries?
Thanks,
Joe