View previous topic :: View next topic |
Author |
Message |
defer- Tux's lil' helper
Joined: 11 Jun 2007 Posts: 140 Location: Finland
|
Posted: Tue Jul 02, 2013 4:04 pm Post subject: static linking with portage |
|
|
Some people seems to think static linking as better practice than dynamic linking. So is it hard to set portage to link statically everything it compiles? AFAIK dynamically linked binaries should be a bit smaller in size and sometimes a bit slower in execution. What is your opinion, dynamic or static linking?
http://harmful.cat-v.org/software/dynamic-linking/ _________________ https://github.com/defer- |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6069 Location: Removed by Neddy
|
Posted: Tue Jul 02, 2013 8:25 pm Post subject: |
|
|
its not so much portage, but the build process of each package.
if you were to make a patch file for each package out there to statically link and then use portage to merge that patch the sure...
but why? you would end up with so much duplication in binary data it would be expensive. _________________ #define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0; |
|
Back to top |
|
|
The Doctor Moderator
Joined: 27 Jul 2010 Posts: 2678
|
Posted: Tue Jul 02, 2013 8:31 pm Post subject: |
|
|
There is the static and static-libs use flags, but they can do weird things. For example, root stops being able to display graphs.
I'd stick with dynamic whenever possible. _________________ First things first, but not necessarily in that order.
Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box. |
|
Back to top |
|
|
defer- Tux's lil' helper
Joined: 11 Jun 2007 Posts: 140 Location: Finland
|
Posted: Tue Jul 02, 2013 9:27 pm Post subject: |
|
|
Yeah i also have understood it that way there would be more disk usage. Some people argue that the static binaries dont grow much larger. Like people from cat-v and suckless. Suckless is planning stali distro with static binaries. I had understood its about CFLAGS or make config to build static binaries, not about patches?
I didnt get it what you meant about root dont be able to display graphs. I really dont need any graphs at all in my system if i got the context right. _________________ https://github.com/defer- |
|
Back to top |
|
|
The Doctor Moderator
Joined: 27 Jul 2010 Posts: 2678
|
Posted: Tue Jul 02, 2013 9:29 pm Post subject: |
|
|
By root I mean the graphing software developed by CERN, not the root user of the computer. Sorry for the confusion. _________________ First things first, but not necessarily in that order.
Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22877
|
Posted: Wed Jul 03, 2013 2:15 am Post subject: |
|
|
Static binaries use more memory because they lose the ability to share library pages among all the processes using that library. I recommend using static linking only when the program must be run in an environment where dynamic linking does not work. |
|
Back to top |
|
|
|