Static Linking Considered Harmful

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#16 Post by technosaurus »

Gparted is a good example the lib*mm.so libs are essentially garbage. Barry even compiles them statically (though he skips the compiler flags needed for removing most of the unneeded sections). As an excercise, try compiling gparted with all shared libs, then with static libs from the devx. Compare the size differences.
Then if you want to see what difference cflags make, rebuild all the mm libs with -ffunction-sections -fdata-sections and -Wl,--gc-sections
(there are more, but these make the most difference)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Ibidem
Posts: 549
Joined: Wed 26 May 2010, 03:31
Location: State of Jefferson

Speaking of Sabotage...

#17 Post by Ibidem »

I've played with Sabotage Linux a little because it uses a libc (musl libc, http://www.etalabs.net/musl/) that matches what I want:
-Standard ABI (fairly constant except for major bugs, aims at LSB ABI compatability so eventually it will work with glibc binaries)
-Small source, quick to build (maybe two-minute build time on an atom at -j1; uses hand-edited config.mak instead of ./configure shell script; 7.2 MB for the latest version of the source + 700 KB includes )
-Standards-conformant source interface (mostly conforms to X/Open. ISO C99, POSIX; treats nonconformance as a bug that must be fixed instead of "wontfix")
-Fully supports static compilation; designed so every function gets its own file for minimum link overhead, no extra shared libs that get dragged in behind your back,
-Small binaries (1.5 mb libc.a includes everything, when glibc takes 3 mb just for libc.a and then has all the other stuff; 550 kb libc.so vs 1.3 mb; and a static or shared binary will be smaller than when linked with glibc)
-Designed for low RAM use--the author wrote it because his computer couldn't run libc6 and libc5 was inadequate.

The standards-conformance attitude is an advantage over every other libc, ABI beats uclibc/klibc, size beats glibc.
I've pondered making a Puppy based on it, but don't know that much; but it sure would be nice for that purpose...
I'm currently working (slowly) on "Muslin", a musl-based Linux distro. The long-term aim is to have something light, fast, and X/Open (SUSv4/UNIX2008) conformant.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#18 Post by disciple »

You guys don't have anything to do with "Starch Linux", do you? It is supposed to be all statically linked, with musl.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

Ibidem
Posts: 549
Joined: Wed 26 May 2010, 03:31
Location: State of Jefferson

#19 Post by Ibidem »

disciple wrote:You guys don't have anything to do with "Starch Linux", do you? It is supposed to be all statically linked, with musl.
Not really, but some of the developers post on the musl mailing list about mostly-unrelated topics.

From what I've seen, it's currently not a bootstrapping environment. It really got started 2 months ago, and is a side/hobby project (ie, slow development).

Post Reply