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

Re: Bug#622931: libav: pkg-config files implies possible static linkage



On Sun, 17 Apr 2011 09:33:41 +0200
Reinhard Tartler <siretart@tauware.de> wrote:

> On Fri, Apr 15, 2011 at 23:48:06 (CEST), Carl Fürstenberg wrote:
> 
> > Package: libav
> > Severity: minor
> >
> > Doing an `pkg-config --static libavcodec --libs` results in following
> > dependices:
> > -pthread -lavcodec -ldl -lX11 -lXext -lXfixes -ljack -lasound -ldc1394 
> > -lraw1394 -lxvidcore -lx264 -lvpx -lvorbisenc -lvorbis -ltheoraenc 
> > -ltheoradec -logg -lspeex -lschroedinger-1.0 -lpthread -lorc-0.4 -lrtmp 
> > -lgnutls -lopenjpeg -lopencore-amrwb -lopencore-amrnb -lmp3lame -lgsm 
> > -lfaac -ldirac_encoder -ldirac_decoder -lstdc++ -lva -lm -lbz2 -lz -lgcrypt 
> > -lavcore -lavutil 
> >
> > But libva-dev and libgpg-error-dev (dep via libgcrypt, which also isn't given) 
> > doesn't provide static versions.
> > This might be outside the area provided by debian packages, but might be
> > worth looking into.
> 
> it rather seems that pkg-config does not provide a way to declare that a
> library does not support static linking at all. I've checked that libva
> simply doesn't support building static libraries in the first place, so
> I've tried to edit the pkg-config file. However, after reading the
> pkg-config documentation, I haven't found the right syntax to express
> this.
> 
> Can someone please help me out here?

http://lists.freedesktop.org/archives/pkg-config/2007-September/000222.html

> Static builds are one of the cases pkg-config doesn't handle well, as
> it does not record whether a static library is present or not. 

Tollef? Any change in that since 2007?

(I'm not expecting such a change as pkg-config doesn't do this for dynamic linkage either, that is left to the package build system. As static is not the default build for most package build systems, it's not unexpected that it simply doesn't work in many cases. Too few people care, too few people to test every single change in the dependency chain.)

Is it possible to define an alternative .pc file which omits libva-dev and libgcrypt? (Even if that means that libav itself needs different ./configure options to be built that way).

If not, maybe this just needs some documentation that static linking for this package - and quite probably many, many others - simply does not work. It's an upstream issue - does upstream care about static linkage? (I'm upstream for a few and I frankly don't care about static linkage in those packages at all. I haven't worked with other upstream teams where I can remember anyone ever expressing interest in static linking either.)

I think it is worth being realistic here. Assuring static linkage support in Debian is, IMHO, simply not attainable for the vast majority of libraries. It's not a fixable problem because not enough people care about it anymore. Changes in static linkage behaviour are not likely to be an ingredient in any Release Team considerations for testing migrations or stable releases, so even if this was done once, it would break almost immediately.

I also think the bug is from a mistaken viewpoint. There is nothing which can be put into a .pc file to imply that static linkage is or is not possible. pkg-config has a --static option but pkg-config doesn't attempt to verify any of the strings it outputs, dynamic or static.

Therefore, libav does not have a pkg-config file which implies possible static linkage. Any package with a .pc file has an implied support for the options which pkg-config supports but that support is only a bug if the package concerned EXPLICITLY declares such support. All packages in Debian can be considered to explicitly support dynamic linking via pkg-config if a .pc file is provided - the same cannot be said for static.

Packages cannot be blamed for lack of support for options made available from tools when those options are not explicitly supported by that particular package.

Certain methods must be supported and, currently, that is dynamic linkage - not static.

IMHO unless every upstream package in the necessary chain states that static linkage is supported by upstream, then static linkage is an "exercise left to the reader" to solve and there's nothing to be done with bugs like this, except possibly state in the packaging docs that static simply does not work "out of the box".

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

Attachment: pgpRT16Lmkybd.pgp
Description: PGP signature


Reply to: