[Buildroot] [PATCH] libtommath: add -fPIC

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Sun May 1 07:35:05 UTC 2016


Hello,

On Sat, 30 Apr 2016 21:43:46 +0200, Peter Korsgaard wrote:

>  > Well, as you've seen yourself, this static library is then used inside
>  > a shared library, so it has to be built -fPIC.  
> 
>  > If you want to build the static library without -fPIC, then the
>  > libtommath package should also provide a shared version of its library,
>  > so that it gets used instead of the static one when linked into a
>  > shared library.  
> 
> Hmm, should we do this for all static only libraries in case they would
> ever get used by a shared library? E.G. ezxml is a similar package.

Well, as soon as some object code ends up being used in a shared
library (directly or via linking to a static library), then it must be
compiled with -fPIC, at least on some architectures (x86_64 and mips
are the one who clearly abort the build if that's not the case).

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list