3 ms·
Isn't that statically compiled though? I haven't checked too much into Rust but I seem to recall it could be dynamically compiled. I would imagine any OS base
by fgonzag 6y ago
Isn't that statically compiled though?
I haven't checked too much into Rust but I seem to recall it could be dynamically compiled. I would imagine any OS base tools would be dynamically compiled anyways.
Though considering the lengths that package managers go to for dependency management, maybe static linking everything is not a bad idea after all, I don't mind a 10GB OS image on disk as long as it isn't actually wasting memory.
- inshadows 6y ago% ldd tabs_sync linux-vdso.so.1 (0x00007fffb06d0000) libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fd523f96000) librt.so.1 => /usr/lib/librt.so.1 (0x00007fd523f8b000) libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fd523f69000) libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fd523f4f000) libc.so.6 => /usr/lib/libc.so.6 (0x00007fd523d88000) /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007fd52490a000) libm.so.6 => /usr/lib/libm.so.6 (0x00007fd523c43000) It still links to libc. It seems most of it is loads of Mozilla stuff. Oh, the nss lib is actually linked statically. Rust Evangelism Strike Force has struck me already. That was fast!
- gpm 6y agoldd just prints the things it dynamically links, which is basically just libc and related system interface libraries. You want to list then number of things it statically links. If you run cargo clean; cargo build, and check out target/debug/deps you should be able to get a list of all the statically linked rust libraries, which is a subset of all the statically linked libraries. Also, as other people mentioned, this is including debug information and so on. Strip it if you care about size. Rust is perfectly happy to make very small executables, you just have to ask it to.