gcc ports and --enable-fully-dynamic-string

Dan Ports dports at macports.org
Tue Nov 29 22:30:28 PST 2011


As many of you may have noticed, gcc46 currently fails to build on
Lion: http://trac.macports.org/ticket/31171

As the discussion in that ticket indicates, the problem seems to be
caused by the --enable-fully-dynamic-string option we're adding to
configure.args. Basically, that needs to match whether the
Apple-provided libstdc++ was built with the same option. If one uses
fully-dynamic-strings and the other doesn't, C++ applications that link
against both will crash and burn.

There are a few other open bugs that may have the same cause: #27237
(same issue on Snow Leopard), #30166, probably others.

We added --enable-fully-dynamic-string in r67282 in response to #22234,
which suggested that Snow Leopard's libstdc++ was built with that
option enabled. I think that may have been mistaken: it doesn't seem to
be true on the versions of Lion and SL that I tried. (Can anyone
confirm definitively whether any version of OS X shipped with libstdc++
built with this option?)


So that leads me to think we should remove --enable-fully-dynamic-string
from configure.args for all versions of the gcc ports on all platforms.
That definitely fixes building gcc46 on Lion. (I suggest removing it
from gcc44 and gcc45 too since it doesn't make sense that it would be
needed on only some versions. I haven't, however, heard any reports of
it causing problems with any versions except gcc46 -- not sure why.)

The problem with doing that is that it will break binary compatibility
with any C++ programs previously compiled with these gcc ports: they'll
be expecting a libstdc++ with fully dynamic strings, and may crash if
they incorrectly attempt to deallocate an empty string. For obvious
reasons, that'd be very undesirable!

I don't, however, currently have any better ideas. Does anyone else?

Dan

-- 
Dan R. K. Ports              MIT CSAIL                http://drkp.net/


More information about the macports-dev mailing list