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

Re: Reason for 10.2 -fPIC requirement



On Sun, Sep 18, 2005 at 05:28:44PM +0200, Loïc Minier wrote:
>         Hi,
> 
>  Policy 10.2: "The shared version of a library must be compiled with
>  -fPIC".
> 
>  This is a "must", but I couldn't find where the requirement comes from
>  (I only checked the changelog).
> 
>  I'm currently trying to resolve Debian bug #268603 where mpeg2dec is
>  built with -fPIC on i386 only.  As far as I understood it, -fPIC is a
>  10% performance improvement on i386 only, and a much smaller
>  improvement on most other arches because they usually have more
>  registers.  I also have read that -fPIC is borken on some !i386 arches.

I guess you mean not using -fPIC is a performance improvement,
and ffmpeg is only not using it on i386.

>  Would someone please sched some light on the origins of this
>  requirement?  If this requirement is only to save memory in most cases,
>  would it be reasonable to permit building with -fPIC by changing this
>  "must" in a "should"?

The problem is that on some architectures not using -fPIC will
just not work (hppa, amd64, alpha) while on others it's the
default (atleast ia64).  I don't now about other arches.  As I
understand it, i386 really is the only arch that supports non-pic
code in a shared object.

There are also ways to avoid the relocations, and I really
recommend everybody making a shared library reads Ulrich
Drepper's dso howto:
http://people.redhat.com/drepper/dsohowto.pdf


Kurt




Reply to: