[avahi] Re: [fwd] acx_pthread fixes for GCC shared/pthread
inconsistency
Sjoerd Simons
sjoerd at luon.net
Sat May 27 12:55:46 PDT 2006
I've included the Avahi mailing list in my reply. To give the avahi people some
context. When i made the acx_pthread patch for avahi, i also proposed it
upstream. Now apparently it's the ``wrong'' solution. Below is the mail from the
acx_pthread author about it.
Steven, thanks for your reply. Avahi does actually use libtool, but still it
fails to build on debian mips without the change to acx_pthread.. If i
understand you correctly this is a bug in libtool then (or avahi's use of it) ?
On Sat, May 27, 2006 at 02:49:35PM -0400, Steven G. Johnson wrote:
> On Sat, 27 May 2006, Steven G. Johnson wrote:
> >This is a bug in the ekg package, which doesn't follow the documentation
> >for ACX_PTHREAD. The documentation clearly states that PTHREAD_CFLAGS
> >must be used for *both* compiling and linking.
>
> Sorry, I had misread the first few lines in the Debian thread. They did
> include -pthread when linking. I have now looked into it more closely,
> and I see what they are doing. However, I still would like you to revert
> the patch.
>
> The problem is that they were not linking an executable, but creating a
> shared library with an inter-library dependency. This is not the problem
> that ACX_PTHREAD solves, and is inherently non-portable. (Although it
> happens to work in some cases.)
>
> ACX_PTHREAD figures out how to link a *program* that needs pthreads.
>
> Creating a shared library is a whole different beast, and the proper way
> to do this portably is to use GNU libtool. Otherwise, to do it right you
> would have to duplicate large parts of libtool in ACX_PTHREAD, which is
> not reasonable. The proposed patch doesn't attempt this, and instead only
> tries to solve the problem for gcc on certain platforms.
>
> (In fact, it's not even *possible* to create shared libraries with
> inter-library dependencies on some platforms.)
>
> Unfortunately, the authors of the ekg program were not using libtool, and
> instead of doing the right thing they hacked acx_pthread instead. This is
> fine for their purpose (getting it to run on Debian), but should not go
> into the official acx_pthread macro.
>
> In summary, please revert the patch. People wanting to build shared
> libraries need to hack on libtool, not acx_pthread.
>
> Steven
--
When you know absolutely nothing about the topic, make your forecast by
asking a carefully selected probability sample of 300 others who don't
know the answer either.
-- Edgar R. Fiedler
More information about the avahi
mailing list