Static vs Shared

Gerard Beekmans gerard at
Tue Jun 27 09:32:36 PDT 2000

> Is there any reason to compile static support if your using
> shared libraries.  Is I am ./configuring, I often see support
> for both configured, but am wondering if static is needed.

In addition to what others have already told (and I hope I'm not
misinterpreting your question): when you configure a library package you
can often choose to configure it to build a static library, a shared
library or both. You have to ask yourself the question whether you would
use a static library. If you ever plan on linking a program statically
you need to have it's support libraries available as static programs.

Imagine the dynamically linked program apache:

chaser:~/pictures$ ldd /usr/apache/bin/httpd => /lib/ (0x4001a000) => /lib/ (0x40037000) => /lib/ (0x40064000) => /lib/ (0x40068000)
        /lib/ => /lib/ (0x40000000)

If you want to have a static apache (a program that does not need
dynamic libraries) you'll need to have the above libraries available as
static ones. All the above are from the GNU C Library. You can always
choose not have any static libraries installed on your system if you
never link anything static. And if you, at some point, do need to
link a program statically you can always install the needed static

Gerard Beekmans

-*- If Linux doesn't have the solution, you have the wrong problem -*-
Mail archive:
IRC access: server: port: 6667 channel: #LFS
Unsubscribe: email lfs-discuss-request at and put
"unsubscribe" (without the quotation marks) in the body of the message
(no subject is required)

More information about the lfs-dev mailing list