[Bug libstdc++/54482] failures in static linking with libstdc++, due to versioned symbols

aaw at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Sep 12 04:58:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54482

--- Comment #3 from Ollie Wild <aaw at gcc dot gnu.org> 2012-09-12 04:58:29 UTC ---
Note, however, that simply changing pic_flag to

  pic_flag="-D_GLIBCXX_SHARED  -fPIC -DPIC"

is insufficient.  It suffers from the same issue as the original problem,
namely that, when configured with --with-pic, pic_flag is passed even when
compiling objects for libstdc++.a.  Since your solution passes -DPIC and
-D_GLIBCXX_SHARED in tandem, keying off the new macro suffers from the same
limitations as the old one.

See my previous comment.  In particular, the link there points to a more
detailed analysis, as well as a patch which outlines the basics of what I think
needs to change.  As you correctly suggest, we need a mechanism to pass flags
based on whether we're compiling for a static or shared library independently
of whether or not -fPIC is used.  The aforementioned patch does that in our
branch, but that will need to be cleaned up and submitted to upstream libtool
before incorporating it in GCC trunk.



More information about the Gcc-bugs mailing list