[FFmpeg-devel] Bugreport: compiling fails with -fPIC used

Michael Niedermayer michaelni
Mon Oct 15 18:42:47 CEST 2007


Hi

On Mon, Oct 15, 2007 at 02:00:30PM +0200, Thorsten Jordan wrote:
> Ronald S. Bultje schrieb:
> > Hi,
> > 
> > On 10/15/07, Thorsten Jordan <tjordan at macrosystem.de> wrote:
> >> btw., what is -mno-dynamic-pic ? my gcc doesnt like it.
> > 
> > 
> > It's -mdynamic-no-pic, sorry...
> 
> i fear it's getting off-topic, but what should that option do? I can't
> find good information after some googling.
> As far as i understood, if the code is not position-independent, it has
> to be re-instantiated in every process that uses libavcodec.so
> (linux/shared libraries), so much more RAM is used. Afaik position
> independence is the precondition for making the sharing of code between
> processes work for shared libraries. If that is true, the flag won't be
> of use here :-/

you sound very confused
first all pages are shared between 2 foobar processes (ignoring stack and
heap of course), that doesnt need shared libs (that is 2
ffmpeg processes share all pages but a mplayer and a ffmpeg process do not)

now with shared libs (and they DO have an overhead both in speed and needed
memory) pages of a lib which are used by 2 processes of 2 different
applications could be shared

with shared lib + PIC (that isnt free either, it has overhead as well) all
such pages can be shared.
without PIC only pages which do not need relocations can
be shared the rest needs to be copied (this is a limitation of the current
toolchain / kernel and nothing fundamental, its very well possible to
share non PIC pages as long as they are at the same position in all
processes ...)

and to ruin your fantasy of the usefullness of shared libs/pic further
it of course only works between applications using the same shared lib
now many applications have a "private" copy of libav* instead of using
some installed libav*
and who uses more than 1 or maybe 2 applications using libav* at the same
time? (ever used xine, vlc, ffmpeg and mplayer at the same time?)

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071015/7f9da5e0/attachment.pgp>



More information about the ffmpeg-devel mailing list