"The GCC/Linux developer community is sold on shared library executables. They like shared libraries due to the reduced memory and disk footprints, as well as the concept that upgrading one shared library eventually automatically upgrades all applications which use that library. Consequently, information on statically linked programs is rather sparse."
— StaticRamLinux, Building Static Compilation Environments
Goals
Stalinux is a linux distribution where all the binaries are statically compiled, no dynamic libraries.
Use gentoo
Recompile Gentoo with the -static flag. Get inspired by Sabayon tbz2 "packages".
IRC
If you are interested to join the project, there is an IRC channel opened at irc.freeenode.net #stalinux
Howto check your gcc
Create a sample file and try to compile it with -static and -Wl,—export-dynamic flags.
First, create a file named test.c with the following contents:
int main(int argc, char **argv)
{
return 0;
}
Second, try to compile it:
# gcc -static -Wl,--export-dynamic test.c
/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in
`/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../lib64/libc.a(strcmp.o)' can
not be used when making an executable; recompile with -fPIE and relink with
-pie
collect2: ld returned 1 exit status
If it returns this error, then your gcc+binutils combination does not work to produce static binaries.