▲ | JoshTriplett 4 days ago | |||||||
> Not OP, but it’s the only way I know how to get gcc to use a static glibc.
| ||||||||
▲ | fuzztester 4 days ago | parent | next [-] | |||||||
>> Not OP, but it’s the only way I know how to get gcc to use a static glibc. > /tmp$ gcc -static -O3 test.c -o test /tmp$ ldd test not a dynamic executable yes, that last line above means it's a statically linked executable. yes, i had a doubt about what the GP said, about their nix way being the only way to create a statically linked executable. but I didn't remember all the details, because it's been a while since I worked with C in depth (moved to Java, Ruby, Python, etc.)(though I did a lot of that earlier, even in pre-Linux years), so I didn't say anything else. thanks, Josh Triplett for clarifying. but one thing I do remember, is that static linking was the only option in the beginning, at least on Unix, and dynamic linking came only some time later. when I started working on UNIX and C, there was no dynamic linking at all, IIRC. https://en.m.wikipedia.org/wiki/Static_library ("dynamic linking" topic in above page links to the below page in Wikipedia: ) | ||||||||
▲ | 3836293648 4 days ago | parent | prev [-] | |||||||
I thought glibc had some hacks in it to prevent it from working fully when statically linked? Is this just a myth or outdated or only affects C/C++ or what? | ||||||||
|