Dear Kan & FSL team,
Thank you for your information. Now I got it why it reports that. According to its document resides in
C:\gcc-arm-none-eabi-4_7-2013q1-20130313-win32\share\doc\gcc-arm-none-eabi\pdf\libc.pdf
Chapter 12. System Calls
The C subroutine library depends on a handful of subroutine calls for operating system services. If you use the C library on a system that complies with the POSIX.1 standard (also known as IEEE 1003.1), most of these subroutines are supplied with your operating system.
If some of these subroutines are not provided with your system—in the extreme case, if you are developing software for a “bare board” system, without an OS—you will at least need to provide do-nothing stubs (or subroutines with minimal functionality) to allow your programs to link with the subroutines in libc.a.
After cloning some source file from other project and updating linker script, it can be built by extra 1KB overhead than C version.
c:/gcc-arm-none-eabi-4_7-2013q1-20130313-win32/bin/arm-none-eabi-size LED_Toggle_flash.elf
text data bss dec hex filename
2964 2140 2104 7208 1c28 LED_Toggle_flash.elf
Now my new problem is, the orginal C LED blink demo doesn't work anymore. Well, it is really an issue. since now I need something like gdb to debug it.
I know C version is good enough for embedded system. However, CPP will be more and more popular.
It comes around to the same point, if FSL can offer any working CPP demo code for GCC on KL, that will be a great help.
After struggling some hours, now I have a build successfully demo (but LED doesn't blink). In current attached file. I have made following modifications:
- Makefile (CPPFLAGS for -fno-rtti -fnoexceptions)
- linker script (sections for heap)
- source file (main.cpp, mini_cpp.cpp for new and delete operators, myclasses as basic CPP test)
I don't know if my modification is correct or not. Any comments are highly appreciated.