[Bug libstdc++/42679] RTLD_DEEPBIND dlopen option for shared library that uses libstdc++ std::ostream crashes

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Dec 29 23:51:00 GMT 2010


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.



More information about the Gcc-bugs mailing list