CFLAGS += -Os
It means optimize for space.CFLAGS += -ffunction-sections -fdata-sections
It means save the function and data to its own sections.LFLAGS += –gc-sections
It means enable garbage collection for unused sections.-fno-rtti -fno-exceptions
Disable the RTTI and exception of cpp.LFLAGS += –specs=nano.specs
Use libc_nano.a libstdc++_nano.a instead of libc.a libstdc++.a
But this one will lead to error and currently no perfect solution was found.