public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "d.v.a at ngs dot ru" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/60936] [4.9/5/6 Regression] Binary code bloat with std::string
Date: Thu, 23 Apr 2015 07:38:00 -0000	[thread overview]
Message-ID: <bug-60936-4-eRnTc6hfcC@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-60936-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60936

--- Comment #11 from __vic <d.v.a at ngs dot ru> ---
Main problem hides in src/c++11/cow-string-inst.cc here:

namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION

  // These came from c++98/misc-inst.cc, repeat them for COW string
  // string related to iostreams.
  template 
    basic_istream<char>& 
    operator>>(basic_istream<char>&, string&);
  template 
    basic_ostream<char>& 
    operator<<(basic_ostream<char>&, const string&);
  template 
    basic_istream<char>& 
    getline(basic_istream<char>&, string&, char);
  template 
    basic_istream<char>& 
    getline(basic_istream<char>&, string&);

_GLIBCXX_END_NAMESPACE_VERSION
} // namespace

It pulls all iostream + locale.

On the whole, dependences between objects within libstdc++ a organized
terribly. When I just use std::string almost all lib will be linked into my
binary!!! If I remove snippet mentioned above + apply fix from Comment 9 this
set of objects is linked:

condition_variable.o
cow-stdexcept.o
cow-string-inst.o
eh_throw.o
functexcept.o
functional.o
futex.o
future.o
ios_failure.o
regex.o
stdexcept.o
string-inst.o
system_error.o

WHY?! I just want std::string!
I use no futures, no regex, no ios::failure, etc... Is all this stuff realy
necessary for my trivial program?


  parent reply	other threads:[~2015-04-23  7:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-23 11:10 [Bug libstdc++/60936] New: " d.v.a at ngs dot ru
2014-04-23 12:12 ` [Bug libstdc++/60936] " d.v.a at ngs dot ru
2014-04-23 12:37 ` d.v.a at ngs dot ru
2014-07-17 10:00 ` [Bug libstdc++/60936] [4.9 Regression] " d.v.a at ngs dot ru
2014-07-19  9:57 ` redi at gcc dot gnu.org
2014-07-19 10:32 ` redi at gcc dot gnu.org
2014-11-19 13:27 ` rguenth at gcc dot gnu.org
2015-04-15 11:36 ` [Bug libstdc++/60936] [4.9/5 " d.v.a at ngs dot ru
2015-04-15 11:38 ` redi at gcc dot gnu.org
2015-04-15 11:40 ` redi at gcc dot gnu.org
2015-04-15 13:41 ` [Bug libstdc++/60936] [4.9/5/6 " d.v.a at ngs dot ru
2015-04-23  7:38 ` d.v.a at ngs dot ru [this message]
2015-05-20  8:44 ` meisenmann.lba@fh-salzburg.ac.at
2015-05-20 11:31 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-60936-4-eRnTc6hfcC@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).