public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc -D_GLIBCXX_FULLY_DYNAMIC_STRING
@ 2010-02-26 19:33 Andreas Leidig
  2010-02-26 19:40 ` John (Eljay) Love-Jensen
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Leidig @ 2010-02-26 19:33 UTC (permalink / raw)
  To: gcc-help

Hello,
   I have a question concerning the std::string 
	 -D_GLIBCXX_FULLY_DYNAMIC_STRING option and gcc :

-Do I have to configure gcc to use this option ?
-if true, how to do this please ?

Best regards

Andreas Leidig

os: Kubuntu Linux kernel 2.6.28-11, gcc 4.3



^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: gcc -D_GLIBCXX_FULLY_DYNAMIC_STRING
  2010-02-26 19:33 gcc -D_GLIBCXX_FULLY_DYNAMIC_STRING Andreas Leidig
@ 2010-02-26 19:40 ` John (Eljay) Love-Jensen
  0 siblings, 0 replies; 2+ messages in thread
From: John (Eljay) Love-Jensen @ 2010-02-26 19:40 UTC (permalink / raw)
  To: Andreas Leidig, gcc-help

Hi Andeas,

> -Do I have to configure gcc to use [ -D_GLIBCXX_FULLY_DYNAMIC_STRING ] option ?

Yes, if you are building your own OS.  (How?  See answer to next question below.)

I think it would be a bad idea otherwise.

As you have probably discovered already, you cannot "opt in" by specifying -D_GLIBCXX_FULLY_DYNAMIC_STRING on a per-compile basis.  As with all the GCC internal flags that start with _GLIB... they are platform specific and should not be modified lightly.

Everything needs to be compiled with that flag uniformly, including the GCC's Standard C++ library, and any other C++ library referenced.

I presume you are running into the situation where two libraries (or a library and an executable) have different notions about the empty string used in that optimization, and is causing an interaction where one is trying to free the static empty buffer from the other.  And then bad things happen.  The general solution to that problem is to make sure the empty string buffer is external link visible (i.e., visibility default, rather than visibility hidden) instead of package visible (i.e., visibility hidden).

> -if true, how to do this please ?

I think you need to configure GCC using --enable-fully-dynamic-string when building GCC for your custom OS.

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-26 12:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-26 19:33 gcc -D_GLIBCXX_FULLY_DYNAMIC_STRING Andreas Leidig
2010-02-26 19:40 ` John (Eljay) Love-Jensen

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).