Mailing List Archive

-fPIC vs -fpic = Headaches
I've come across a fun little issue lately when building sparc64

Some shared libaries need -fPIC to compile (libpcap for example), that's
an easy fix. However, some libraries compile fine with -fpic (libkudzu
for example). The issues is that shared libraries compiled with -fpic
can cause issues later on depending on how they are included into a
dependent application. An example is is hwsetup, which is compiled with
-fPIC by default, but depends on libkudzu which is compiled with -fpic
by default. This causes hwsetup to fail during compilation. This only
seems to be a issue with sparc64 and not sparc, as sparc64 still has a
lot of the same register restrictions that sparc has but with a higher
memory footprint.

Im tempted to say that everything on sparc should be compiled with -fPIC
over -fpic. This is how Debian does it (i believe they do it for every
arch). The reason i say this is because there is no way to tell if a
-fpic shared library will be a problem down the line in another
application. Short of building the whole portage tree repeatedly.

Right now im just fixing them as i come across them, but i'd like to
know anyones thoughts on this issue.