How to generate statically linked executables?
问题 I am trying to create a static executable with Rust. I am not trying to statically link a particular library, I am trying to create a executable which does not use dynamic linking at all . I have the following (otherwise working) test: $ cat hello.rs fn main() { print!("Hello, world!\n"); } $ rustc hello.rs -o hello $ file hello hello: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, [etc] Note the dynamically linked,