View previous topic :: View next topic |
Author |
Message |
Nitro Bodhisattva
Joined: 08 Apr 2002 Posts: 661 Location: San Francisco
|
Posted: Wed May 08, 2002 2:11 am Post subject: Compile everything as static? |
|
|
I noticed that there is a "static" USE flag for portage in /usr/portage/profiles/use.desc. This leads to me to think... Would compiling stuff like X, Mozilla, Enlightenement, and galeon run faster? It wouldn't have to load the libraries at run time right? _________________ - Kyle Manna
Please, please SEARCH before posting.
There are three kinds of people in the world: those who can count, and those who can't. |
|
Back to top |
|
|
slik n00b
Joined: 18 Apr 2002 Posts: 48 Location: Alberta, Canada
|
Posted: Wed May 08, 2002 3:32 am Post subject: Re: Compile everything as static? |
|
|
Nitro wrote: | Would ... run faster? |
It would have to load the extra functions statically linked into the binary, so the binaries would be larger. You wouldn't save on load time if a library is already in memory. Static binaries would run slightly faster, everthing else being equil.
Static binaries would be more reliable however, in that they won't break if an underlying library is removed/upgraded (libpng). |
|
Back to top |
|
|
AnimalMachine Tux's lil' helper
Joined: 27 Apr 2002 Posts: 106 Location: Milwaukee, WI USA
|
Posted: Wed May 08, 2002 2:03 pm Post subject: |
|
|
In addition to what slik pointed out, here are some negatives (I'm naturally pessimistic ):
#1 You also wouldn't be able to fix bugs in the libraries by upgrading the library package. Think of the zlib security bug that was found a little bit ago.
#2 The size of the binary would also increase, and if this is done as a system-wide policy, a substantial amount of space could be wasted. Of course, this probably only matters on space-constrained system ... not such a big deal when installing on a 20+ gb ext3 partition.
For me, #1 is probably the biggest reason to use dynamic libraries. But then again, you could just say that the potential to create bugs balances out the potential to fix bugs. |
|
Back to top |
|
|
UTRules n00b
Joined: 11 May 2002 Posts: 10
|
Posted: Sat May 11, 2002 10:56 pm Post subject: |
|
|
FWIW, on Redhat 7.2 both galeon and mozilla are static binaries.
I tend to agree with slik - the best reason for compiling statically is to keep your executable from breaking when system libraries get upgraded. Speed seems to be an issue in Linux with large C++ libraries like KDE has to deal with - hence the objprelink hack. The other edge of the static compiling sword is that you're going to have more copies of the same code loaded into memory, which is a less efficient use of resources than shared libraries. |
|
Back to top |
|
|
Nitro Bodhisattva
Joined: 08 Apr 2002 Posts: 661 Location: San Francisco
|
Posted: Sun May 12, 2002 1:05 am Post subject: |
|
|
Well, and statically compiled binaries are easier to throw in to a chroot. _________________ - Kyle Manna
Please, please SEARCH before posting.
There are three kinds of people in the world: those who can count, and those who can't. |
|
Back to top |
|
|
|