[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libtool zealeousness: how to stip off -pthread added by libtool



Jerome BENOIT <g6299304p@rezozer.net> writes:

> for my current packaging, a program that does not use pthread directly
> is linked against a library that uses (intensively) pthread:  libtool
> add the option -pthread while is not necessary (and not wanted in my
> case).

I'm a little dubious that this is guaranteed to always be the case.  The
reason why libraries that use pthreads heavily export that linker flag is
that I believe there are some situations where this *does* matter and the
program needs to be linked with -pthread when it uses such libraries, even
if it doesn't use pthreads itself.

I'm not sure if any of those situations occur on Linux, but I would be a
little dubious about removing this.

> So I get the following warning message from dpkg-shlibdeps:

> warning: package could avoid a useless dependency if debian/tachyon-bin-nox/usr/bin/tachyon-nox was not linked against libpthread.so.0 (it uses none of the library's symbols)

Note that libpthread is included in the libc6 package already, so while
there's a warning about this, it doesn't create any unnecessary package
dependencies.  That means this causes essentially zero ill effects for
your program (in fact, I wonder if libpthread should just be whitelisted
for this check in dpkg-shlibdeps).  That's particularly true since your
program is linked with a library that uses libpthread, so libpthread is
going to be loaded by your program anyway.

In short, I'd just ignore this.  That's what I do in similar situations
for my packages.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: