Re: Should .a library contains non-reallocatable code?
Ian Jackson writes ("Re: Should .a library contains non-reallocatable code?"):
> Jeff is correct.
...
> That not usually a problem. Providing that only the relevant symbols
> are exported from the .so, the executable simply results in multiple
> completely independent copies of the static library.
I should say that I agree with the conclusions of others in this
thread, that policy's rules about -fPIC for static libraries are
wrong.
Where only a static library is provided, it should be built _with_
-fPIC unless it is expected never to be included in any shared object
(which is probably hard to predict, but I guess there might be cases
where the maintainer might know).
Where a .so is provided too then the static library is normally used
only in cases where no dynamic linking is done at all, and then
-fPIC is probably undesirable. This is of course the usual case.
Ian.
Reply to: