Description
Hi,
I wanted to switch a bunch of C++ applications from newlibc nano to picolibc but I noticed it resulted in ~4 kB flash usage growth. I realized it was because nano.specs
replaces -lstdc++
flag with -lstdc++_nano
, while picolibc.specs
does not. The full libstdc++
contains a lot of code for handling exceptions and stack unwinding, which is often not needed in embedded applications.
I forced the build system to use -lstdc++_nano
by adding set_linker_property(PROPERTY c++_library "-lstdc++_nano")
in CMakeLists, and the flash usage dropped by ~10kB.
Would it make sense to default to lstdc++_nano
when linking with picolibc or at least support the nano variant to be used by applications that disable C++ exceptions?
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status