3 ms·
Huh? Perhaps you mean Glib? Static linking works just fine with glibc: [me@host: tmp]% cat > hello.c #include <stdio.h> int main(void) { printf("hello
by 1amzave 14y ago
Huh? Perhaps you mean Glib? Static linking works just fine with glibc:
[me@host: tmp]% cat > hello.c
#include <stdio.h>
int main(void) { printf("hello world\n"); return 0; }
[me@host: tmp]% gcc -o hello -Wall hello.c -static
[me@host: tmp]% file hello
hello: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.32, not stripped
[me@host: tmp]% ldd hello
not a dynamic executable
[me@host: tmp]% ./hello
hello world
- saurik 14y agoI largely agree with you, but for what it's worth, that doesn't "just work": there are places in glibc that use dlopen to pull in modular code; one example is the DNS resolver.
- tedunangst 14y agoAs mentioned, if you try that it works less than 100%. Trying to run a 32-bit program on a 64-bit host will fail in weird ways unless some of the expected bonus libraries are available.