This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/54482] failures in static linking with libstdc++, due to versioned symbols
- From: "aaw at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Sep 2012 04:58:29 +0000
- Subject: [Bug libstdc++/54482] failures in static linking with libstdc++, due to versioned symbols
- Auto-submitted: auto-generated
- References: <bug-54482-4@http.gcc.gnu.org/bugzilla/>
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.