3 ms·
Golang makes statically linked binaries. (Well, until you use cgo.) By default, Crystal generates dynamically linked binaries. You absolutely do not need Cryst
by floatboth 8y ago
Golang makes statically linked binaries. (Well, until you use cgo.)
By default, Crystal generates dynamically linked binaries. You absolutely do not need Crystal to run them. But you do need:
- Boehm GC (libgc-threaded)
- libevent
- PCRE if the program uses regexps
- libyaml if the program uses yaml
- OpenSSL if the program uses crypto/TLS (?)
Here's an example ldd output:
/usr/local/bin/shards:
libyaml-0.so.2 => /usr/local/lib/libyaml-0.so.2 (0x8c0bb1e000)
libpcre.so.1 => /usr/local/lib/libpcre.so.1 (0x8c0bd3c000)
libm.so.5 => /lib/libm.so.5 (0x8c0bfb8000)
libgc-threaded.so.1 => /usr/local/lib/libgc-threaded.so.1 (0x8c0c1e6000)
libthr.so.3 => /lib/libthr.so.3 (0x8c0c444000)
libevent-2.1.so.6 => /usr/local/lib/libevent-2.1.so.6 (0x8c0c66c000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x8c0c8c3000)
libc.so.7 => /lib/libc.so.7 (0x8c0cad2000)
libdl.so.1 => /usr/lib/libdl.so.1 (0x8c0ce8f000)
libcrypto.so.42 => /usr/local/lib/libcrypto.so (0x8c0d091000)
You can try `crystal build --static` though :)
- snake_case 8y agoThanks for explaining! In other threads, I've seen people refer to them as fat binaries, but yes, I've also seen them referred to as statically linked binaries.