Comment 11 for bug 640734

Revision history for this message
Doug Royer (douglasroyer) wrote :

You CAN link ARCHIVE libraries when building dynamic libraries.
As long as the archive (.a) was compiled with -fPIC/-fpic.

I do it all the time when building shared libraries for embedded devices, where you do not want to distribute a massive shared library, or multiple shared libraries. By building the embedded archive libraries with -fPIC/-fpic, you can link them and build one new shared library. In fact many open source project build multiple archive libs, then link at the final step into the final dynamic library.

The problem is not -shared which is misleading. The issue is was the archive library built with -fPIC/-fpic or not?

The bug exists, because when building a -fPIC/fpic archive library (linked with -Bstatic libName -Bdynamc, where libName WAS compiled dynamic, you get the error.