This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/42679] RTLD_DEEPBIND dlopen option for shared library that uses libstdc++ std::ostream crashes
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 29 Dec 2010 23:50:57 +0000
- Subject: [Bug libstdc++/42679] RTLD_DEEPBIND dlopen option for shared library that uses libstdc++ std::ostream crashes
- Auto-submitted: auto-generated
- References: <bug-42679-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42679
--- Comment #19 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-12-29 23:50:51 UTC ---
(In reply to comment #16)
> I am using "-fpic/-fPIC" and in fact am using:
> // g++ -g -O0 main.cpp -ldl
> // g++ -g -O0 -rdynamic -c -fPIC -o library.o library1.cpp
> // g++ -shared -Wl,-export-dynamic -o library.so library.o
What if you use -fPIC for the last step? (The manual does say it's necessary
for predictable results when using -shared)
(In reply to comment #17)
> This is with using gcc for linking instead of g++.
The main difference is that g++ automatically links to libstdc++, but if you
use gcc and link to libstdc++ then you still get the same effect.