You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Jeff Trawick <tr...@attglobal.net> on 2003/10/30 12:49:20 UTC
Re: cvs commit: apr/build apr_threads.m4
jorton@apache.org wrote:
> jorton 2003/10/29 13:11:46
>
> Modified: build apr_threads.m4
> Log:
> * build/apr_threads.m4: If -pthread is used to enable
> pthread support, also add -lpthread to LIBS to ensure
> that libapr depends on libpthread regardless of libtool
> and gcc versions.
$ apxs -c -p -o pgm pgm.c
Ahh, relief from all those unresolved libpthread symbols.
Cool!
Re: cvs commit: apr/build apr_threads.m4
Posted by Jeff Trawick <tr...@attglobal.net>.
Joe Orton wrote:
> On Thu, Oct 30, 2003 at 06:49:20AM -0500, Jeff Trawick wrote:
>
>>jorton@apache.org wrote:
>>
>>>jorton 2003/10/29 13:11:46
>>>
>>> Modified: build apr_threads.m4
> That change broke the OpenBSD build which uses -pthread with -lc_r not
> -lpthread. The change I just committed fixes cases like that too, but
> it could do with some testing with the vendor cc on Solaris/AIX/... it
> seems to now do the right thing with gcc on the platforms I've tested.
>
> Is it OK on Solaris to link against libpthread *and* libthread? I can't
> remember.
yes, it is OK/normal... it is a showstopper to get libthread without libpthread
though
if there is something messed up on AIX, I'll find out pretty soon; with the
vendor compiler I've only used it via the "_r" flavor of the front-end (e.g.,
"CC=cc_r" or "CC=xlc_r") if I want a thread-capable build... no telling what
happens if plain CC=cc is used...
Re: cvs commit: apr/build apr_threads.m4
Posted by Joe Orton <jo...@manyfish.co.uk>.
On Thu, Oct 30, 2003 at 06:49:20AM -0500, Jeff Trawick wrote:
> jorton@apache.org wrote:
> >jorton 2003/10/29 13:11:46
> >
> > Modified: build apr_threads.m4
> > Log:
> > * build/apr_threads.m4: If -pthread is used to enable
> > pthread support, also add -lpthread to LIBS to ensure
> > that libapr depends on libpthread regardless of libtool
> > and gcc versions.
>
> $ apxs -c -p -o pgm pgm.c
>
> Ahh, relief from all those unresolved libpthread symbols.
>
> Cool!
That change broke the OpenBSD build which uses -pthread with -lc_r not
-lpthread. The change I just committed fixes cases like that too, but
it could do with some testing with the vendor cc on Solaris/AIX/... it
seems to now do the right thing with gcc on the platforms I've tested.
Is it OK on Solaris to link against libpthread *and* libthread? I can't
remember.
bash-2.02$ gcc -shared -pthreads -fpic foo.c -lpthread
bash-2.02$ ldd a.out
libpthread.so.1 => /usr/lib/libpthread.so.1
libthread.so.1 => /usr/lib/libthread.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libc.so.1 => /usr/lib/libc.so.1