This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix -pthread for PowerPC/Linux shared libraries
On Wed, Sep 17, 2003 at 10:44:29AM -0400, Daniel Jacobowitz wrote:
> On Wed, Sep 17, 2003 at 11:39:37PM +0930, Alan Modra wrote:
> > On Wed, Sep 17, 2003 at 09:44:01AM -0400, Daniel Jacobowitz wrote:
> > > --- sysv4.h 19 Jun 2003 21:47:22 -0000 1.135
> > > +++ sysv4.h 17 Sep 2003 13:41:52 -0000
> > > @@ -1065,7 +1065,7 @@ extern int fixuplabelno;
> > >
> > > /* GNU/Linux support. */
> > > #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
> > > -%{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
> > > +%{!mnewlib: %{shared:-lc} %{pthread:-lpthread } %{!shared: \
> > > %{profile:-lc_p} %{!profile:-lc}}}"
> > >
> > > #ifdef HAVE_LD_PIE
> >
> > I find the library order a little suspect, both before and after this
> > patch. Why is -lc listed before -lpthread when shared?
>
> Again, coincidence, I imagine. But does it matter? My impression was
> that library order only made a difference with shared libraries.
>
> Oh, blech, libc.so and libpthread.so are both linker scripts with a
> _nonshared.a now...
For older glibcs (ie. < this year) it matters a lot.
Link dynamically with -lc -lpthread and lots of things will not be
thread safe.
Jakub