[Mageia-dev] rpmrc [5221] build with -fPIC on x86_64 too (pok, mdv)

Anssi Hannula anssi at mageia.org
Thu Jan 10 02:54:33 CET 2013


26.09.2012 22:57, Thierry Vignaud kirjoitti:
> On 26 September 2012 20:30, Anssi Hannula <anssi at mageia.org> wrote:
>>> Author
>>>     tv
>>
>>>       Log Message
>>>
>>> build with -fPIC on x86_64 too (pok, mdv)
>>
>> Why?
> 
> "-fPIC should already be used on x86_64 or you'll get sooner or later in
>  troubles (for instance when linking libs). I think that any sane build
>  script should already default to -fPIC on x86_64 but some other weird
>  build script may not." (rtp)

I have to strongly disagree with this.

- This hides problems in build scripts. Shared libraries should normally
  be linked with -fPIC on *all* architectures. Not doing this causes
  some issues, like the library to actually become unshareable across
  different processes. Since these are allowed in iX86 but not on
  x86_64, building all objects on x86_64 with -fPIC will hide any
  "missing -fPIC from build script" issues.
  Note that there can't be very many problematic failing packages, since
  we and mdv have managed this far without it.

- It is not needed except on shared libraries, and will cause a small
  performance penalty (due to one less register being available when
  using relative addressing). (AFAIU it is negligible, but still..)

- Other major distros (not counting MDV) do not do this

-- 
Anssi Hannula


More information about the Mageia-dev mailing list