I analyzed a project generated by Simplicity Studio (Eclipse IDE variation of Silicon Labs for their Microcontrollers).
I used the default setup for a ASM/C/C++ project based on the arm-none-eabi-gcc toolchain.
For the G++-Linker-Flags, they do something which appears to me as super strangely: They intend to link against the newlib-nano (So the small version of the standard library).
However, ususally you would need to decide whether you intend to use redirection and therefore link against nosys.specs, which also will make your binary bigger, or the minimalistic one which is nano.specs.
However, they do list both options, which does not make sense to me. So i checked another project setup (this on a CM3 from STM32) and they apparently do the same. Why is this?
If i do not intend to use redirection (like for filesystems, printf/_write, etc..), do i NEED TO list nosys.specs?
Additional question: Does the order of those flags matter or is this simply a list of all options you want to add?
-g3 -gdwarf-2 -mcpu=cortex-m3 -mthumb -T "${BuildArtifactFileBaseName}.ld" --specs=nosys.specs -Xlinker --gc-sections -Xlinker -Map="${BuildArtifactFileBaseName}.map" --specs=nano.specs