Currently terminate() [eh_term_handler.cc] drags in stdio since it
calls __gnu_cxx::__verbose_terminate_handler(). This means
that a C++ program on a small embedded system has a much larger
footprint than necessary, since it includes stdio, even if the
program does not use any stdio routines.
If built with !_GLIBCXX_HOSTED, terminate calls abort(), which saves
considerable memory. But this means that no programs can be built
which use stdio.
The attached patch creates a new define _GLIBCXX_NO_VERBOSE_TERMINATE,
which splits the difference. If set, terminate() will call abort().
Programs which use stdio will have the larger footprint.
This is on the Microblaze branch. I would also like to check in the
target-independent parts on HEAD.
2009-09-16 Michael Eager <eager@eagercon.com>
libstdc++-v3:
* configure: Regenerate.
* libsupc++/eh_term_handler.cc[_GLIBCXX_NO_VERBOSE_TERMINATE]:
New test.
* configure.host[microblaze-*]: Add cpu_defines_dir.
* config.h.in[_GLIBCXX_NO_VERBOSE_TERMINATE]: Define.
* config/cpu/microblaze/cpu_defines.h: New.