3 ms·
libc is not tiny either. Try compiling helloworld.c using gcc with -static option. You get a similar size. I don't use Go much but I recall comparing binarie
by snarfy 8y ago
libc is not tiny either. Try compiling helloworld.c using gcc with -static option. You get a similar size. I don't use Go much but I recall comparing binaries and a Go binary was about 200k larger than a binary from gcc compiling C.
- mahkoh 8y agoglibc cannot be linked statically.[1] Compile hello world against musl libc with -static and you get an 8kb binary. [1] https://sourceware.org/glibc/wiki/FAQ#Even_statically_linked_programs_need_some_shared_libraries_which_is_not_acceptable_for_me.__What_can_I_do.3F https://sourceware.org/glibc/wiki/FAQ#Even_statically_linked...
- dottrap 8y agoHere's another link which compares musl, uClibc, dietlibc, and glibc sizes, features, and performance. http://www.etalabs.net/compare_libcs.html http://www.etalabs.net/compare_libcs.html It says musl's smallest static C program can be 1.8k as opposed to glibc's 662k, showing libc doesn't always have to be big and bloated.