This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -lpthread -lstdc++ crashes on IRIX 6.5
On Tue, Feb 22, 2011 at 01:06:01AM +0000, Jonathan Wakely wrote:
> > We're rebuilding now with a modified g++spec.c (patched to reorder
> > -lpthread after -lstdc++), but still not sure that is the correct fix
> > for this.
>
> The reason I asked is that on most platforms -pthread does two things,
> it uses -D_REENTRANT when compiling (technically when preprocessing)
> and uses -lpthread when linking. On some platforms doing one without
> the other is not supported, so you should use -pthread when compiling
> and when linking.
While I agree with all of this, adding -lpthread to the link line as
well as -pthread should not cause the resulting application to crash.
I see I never got to that in my original mail, sorry :(. Even if we
consistently use -pthread for compiling and linking with gcc, we
sometimes end up with a -lpthread on the link line (often because
libtool has it in some .la files dependency_libs, sometimes due to
pkgconfig), and when that happens the resulting application crashes at
launch.
Peter
--
Peter O'Gorman
pogma@thewrittenword.com