-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-metadataArea: Crate metadataArea: Crate metadataC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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!");
}
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-metadataArea: Crate metadataArea: Crate metadataC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.