This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Static library for gcc compiling
Matthias David Siebler wrote:
I believe this is due to the fact that you cannot use the dynamic
library from a static image.
I think the reason is that libdl.so actually uses the dynamic runtime
linker to resolve the symbols. Static images do not have access to
this, so the library will not work.
Can someone with a better understanding of this issue confirm this for
me? Thanks,
Matthias,
You are correct about libdl.so resoliving symbols. It allows your
program to read in symbols from other .so files at runtime. There is
only a .so version of it. It is possible to have a program that is
otherwise linked statically to be linked with libdl.so. You can choose
which libs you want to be static and which to dynamic. You can have the
standard libs, like those under /usr/lib linked dynamically, and have
private libs linked statically. This way you can use the binary on
machines that don't have your private libs.
Andy