This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libstdc++: Option to not include stdio in terminate


Michael Eager wrote:
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.

The regenerated libstdc++-v3/configure is not needed.



-- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]