I am having a recurring set of problems on my gentoo AMD64 box, getting errors like:
Specifically, I am developing a shared library, and am attempting to link into it several static libraries (i.e. Boost, ANTLR). On an x86 platform, this is not a problem, however, AMD64 requires the static libraries to have been compiled with the -fPIC option. Now, the general libtool default is to build shared libraries from PIC objects and static archives from non-PIC objects, so anyone attempting to do what I am trying to do runs into a non-trivial task of editing a bunch of ebuilds to get various libraries compiled with the necessary -fPIC. This can involve several time-consuming rebuilds. For example, to attempt to build Boost with the -fPIC option causes trouble with gcc (crtbeginT.o to be specific), and would also require rebuilding gcc with -fPIC.xxx can not be used when making a shared object; recompile with -fPIC
Now, I am not an expert, and I don't know if there is a downside to compiling a static library with -fPIC versus non-PIC objects, and info on the web is fairly limited. I thought I would consult the gentoo AMD64 community and see if any guidelines exist on the subject. Currently, I am stuck with locally building some libraries, or maintaining some modified ebuilds in /usr/local/portage. I am hoping there may be a better/more accepted way to deal with this across the gentoo AMD64 distribution.
Best,
Scott


