Closed
Description
rustc --emit=obj,metadata helloworld.rs
generates a linking error as below:
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L"
...
,-Bdynamic" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
= note: cc: error: helloworld.helloworld.7rcbfp3g-cgu.0.rcgu.o: No such file or directory
error: aborting due to previous error
Both rustc --emit=obj helloworld.rs
and rustc --emit=metadata helloworld.rs
work.
To reproduce, the code of helloworld.rs
is:
// This is the main function
fn main() {
println!("Hello World!");
}