Bug 43852 - Embedded systems friendly libstdc++
Summary: Embedded systems friendly libstdc++
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.5.0
: P3 enhancement
Target Milestone: 4.8.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-22 14:24 UTC by Sebastian Huber
Modified: 2012-09-09 23:09 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-06-24 12:21:35


Attachments
Example how to implement it (463 bytes, patch)
2010-04-22 14:25 UTC, Sebastian Huber
Details | Diff
Lets call it quiet. (463 bytes, patch)
2010-04-23 09:20 UTC, Sebastian Huber
Details | Diff
Implementation, configure and documentation (2.45 KB, patch)
2010-06-24 09:41 UTC, Sebastian Huber
Details | Diff
Implementation, configure and documentation (2.60 KB, patch)
2010-06-24 10:09 UTC, Sebastian Huber
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Huber 2010-04-22 14:24:21 UTC
You can configure the standard C++ library in two ways to reduce the code size and dependencies on external libraries:

1. --enable-cxx-flags=-fno-exceptions

This does currently not work, due to an error in guard.cc which defines recursive_init_error::~recursive_init_error() and this results in a dependency on pure.cc and this one pulls in the IO library.

2. --disable-hosted-libstdcxx

This is also broken currently (try to build it).

Embedded targets may provide a hosted C environment, but in some cases it is useless to provide output messages.  Also the IO library is quite huge.  Two files in libstdc++/libsupc++ pull in the IO library: pure.cc and eh_term_handler.cc (via vterminate.cc).  It would be nice to have a configure option (like --enable-verbose-cxx) to enable or disable the output generation in these files.
Comment 1 Sebastian Huber 2010-04-22 14:25:32 UTC
Created attachment 20463 [details]
Example how to implement it
Comment 2 Jonathan Wakely 2010-04-22 14:51:10 UTC
So this should be three bugs, one for each of the build problems and one enhancement request for a semi-hosted environment.  I don't think "verbose" is a good name for the default case, I would prefer something like "quiet" for your suggested new mode
Comment 3 Paolo Carlini 2010-04-22 17:02:58 UTC
Good point about splitting to two or three bugs, because the build issues can probably be fixed in the 4_5-branch too.
Comment 4 Sebastian Huber 2010-04-23 09:16:35 UTC
Bug report for 1. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43863.

Bug report for 2. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43865
Comment 5 Sebastian Huber 2010-04-23 09:20:29 UTC
Created attachment 20471 [details]
Lets call it quiet.

Configure option may be --enable-quiet-cxx.
Comment 6 Jonathan Wakely 2010-04-23 09:37:15 UTC
thanks for filing the other two bugs

confirmed as an enhancement
Comment 7 Sebastian Huber 2010-06-24 09:41:23 UTC
Created attachment 20993 [details]
Implementation, configure and documentation

Is libstdc++-v3/doc/xml/manual/configure.xml the main source for documentation?
Comment 8 Paolo Carlini 2010-06-24 10:02:33 UTC
Jon, can you follow this one too?
Comment 9 Sebastian Huber 2010-06-24 10:09:54 UTC
Created attachment 20995 [details]
Implementation, configure and documentation

Sorry, the config.h.in was missing.
Comment 10 Paolo Carlini 2010-06-24 10:19:03 UTC
In general, regenerated files should not be posted at all, when submitting patches / changes.
Comment 11 Jonathan Wakely 2010-06-24 12:21:35 UTC
(In reply to comment #7)
> 
> Is libstdc++-v3/doc/xml/manual/configure.xml the main source for documentation?

Yes, however as you don't have a copyright assignment in place, submitting these patches might actually make it *harder* for us, as we can't use your work if it's anything substantial.

I'll get this and Bug 44647 done for 4.6.0

Comment 12 Sebastian Huber 2010-06-24 12:49:06 UTC
(In reply to comment #11)
[...]
> I'll get this and Bug 44647 done for 4.6.0

Please have a look at Bug 43863 also.
Comment 13 Paolo Carlini 2011-01-11 16:36:29 UTC
Jon, are we going to resolve this in time for 4.6.0?
Comment 14 Jonathan Wakely 2011-01-11 16:41:56 UTC
If you have no objections I'll resolve PR 43863 for 4.6.0 (by putting recurisve_init_error in a separate file) but I think this "quiet mode" needs a bit more thought and time
Comment 15 Paolo Carlini 2011-01-11 16:48:38 UTC
Of course no objections, I just couldn't figure out what we were up to.
Comment 16 Jakub Jelinek 2011-03-25 19:53:16 UTC
GCC 4.6.0 is being released, adjusting target milestone.
Comment 17 Jonathan Wakely 2011-03-25 21:14:04 UTC
changing target, this didn't happen for 4.6 but I want to do it for 4.7
Comment 18 Jonathan Wakely 2012-05-31 13:50:52 UTC
Sorry for not finding time to work on this. I'm unassigning myself in case anyone else wants to do it, as I've got several higher priority items and am unlikely to work on this any time soon.
Comment 19 Jonathan Wakely 2012-08-27 17:18:34 UTC
I finally got time to work on this and have posted an updated patch to http://gcc.gnu.org/ml/gcc-patches/2012-08/msg01879.html

I went with your original idea of disabling the "verbose" default rather than enabling a "quiet" alternative. On reflection I thought your name was better as it's consistent with the verbose terminate handler.

Sorry this took so long to deal with!
Comment 20 Jonathan Wakely 2012-09-09 23:08:54 UTC
Author: redi
Date: Sun Sep  9 23:08:48 2012
New Revision: 191121

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191121
Log:
2012-09-10  Sebastian Huber  <sebastian.huber@embedded-brains.de>
	    Jonathan Wakely  <jwakely.gcc@gmail.com>

	PR libstdc++/43852
	* acinclude.m4 (GLIBCXX_ENABLE_VERBOSE): Define.
	* configure.ac (GLIBCXX_ENABLE_VERBOSE): Use it.
	* config.h.in: Regenerate.
	* configure: Likewise.
	* libsupc++/eh_term_handler.cc (_GLIBCXX_VERBOSE): Check new macro.
	* libsupc++/pure.cc (_GLIBCXX_VERBOSE): Likewise.
	* doc/xml/manual/configure.xml (--disable-libstdcxx-verbose): Document.
	* doc/html/manual/configure.html: Regenerate.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/acinclude.m4
    trunk/libstdc++-v3/config.h.in
    trunk/libstdc++-v3/configure
    trunk/libstdc++-v3/configure.ac
    trunk/libstdc++-v3/doc/html/manual/configure.html
    trunk/libstdc++-v3/doc/xml/manual/configure.xml
    trunk/libstdc++-v3/libsupc++/eh_term_handler.cc
    trunk/libstdc++-v3/libsupc++/pure.cc
Comment 21 Jonathan Wakely 2012-09-09 23:09:53 UTC
Done for 4.8.0