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

Re: Should .a library contains non-reallocatable code?



* Jeff Epler <jepler@unpythonic.net>, 2015-02-19, 17:19:
Here are two scenarios where building a static library (libfoo) with -fPIC is desirable:

* libbar has a stable API, so it should be shipped as a .so, but if it links libfoo.a, and libfoo.a is not -fPIC, then libbar has to be shipped as a a static library too

* foomodule is a Python wrapper for libfoo, so it must be shipped as a .so, but if it links libfoo.a, and libfoo.a is not -fPIC, it is not possible to build foomodule at all


I'll add:

* User wants to build position-independent executable that links to libfoo.a.

I wonder whether these scenarios were considered when the Policy was written.

IMO the policy is overly strict and it should be relaxed.

--
Jakub Wilk


Reply to: