File tree Expand file tree Collapse file tree
compiler/rustc_codegen_ssa/src/back Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -736,13 +736,15 @@ impl<'a> Linker for GccLinker<'a> {
736736 fn enable_profiling ( & mut self ) {
737737 // This flag is also used when linking to choose target specific
738738 // libraries needed to enable profiling.
739- self . cc_arg ( "-pg" ) ;
740- // On windows-gnu targets, libgmon also needs to be linked, and this
741- // requires readding libraries to satisfy its dependencies.
742- if self . sess . target . is_like_windows {
743- self . cc_arg ( "-lgmon" ) ;
744- self . cc_arg ( "-lkernel32" ) ;
745- self . cc_arg ( "-lmsvcrt" ) ;
739+ if !self . is_ld {
740+ self . cc_arg ( "-pg" ) ;
741+ // On windows-gnu targets, libgmon also needs to be linked, and this
742+ // requires readding libraries to satisfy its dependencies.
743+ if self . sess . target . is_like_windows {
744+ self . cc_arg ( "-lgmon" ) ;
745+ self . cc_arg ( "-lkernel32" ) ;
746+ self . cc_arg ( "-lmsvcrt" ) ;
747+ }
746748 }
747749 }
748750
You can’t perform that action at this time.
0 commit comments