diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs index ee097b5f05199..0f56d7bfa8501 100644 --- a/compiler/rustc_codegen_ssa/src/back/linker.rs +++ b/compiler/rustc_codegen_ssa/src/back/linker.rs @@ -1048,6 +1048,10 @@ impl<'a> Linker for EmLinker<'a> { } fn link_staticlib(&mut self, lib: Symbol, _verbatim: bool) { + // remove -lc: the compiler driver emcc will add it if its needed. + if lib.as_str() == "c" { + return; + } self.cmd.arg("-l").sym_arg(lib); }