File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
compiler/rustc_codegen_ssa/src/back Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -404,12 +404,14 @@ impl<'a> GccLinker<'a> {
404404 fn build_dylib ( & mut self , crate_type : CrateType , out_filename : & Path ) {
405405 // On mac we need to tell the linker to let this library be rpathed
406406 if self . sess . target . is_like_osx {
407- if !self . is_ld {
407+ if self . is_cc ( ) {
408+ // `-dynamiclib` makes `cc` pass `-dylib` to the linker.
408409 self . cc_arg ( "-dynamiclib" ) ;
410+ } else {
411+ self . link_arg ( "-dylib" ) ;
412+ // Clang also sets `-dynamic`, but that's implied by `-dylib`, so unnecessary.
409413 }
410414
411- self . link_arg ( "-dylib" ) ;
412-
413415 // Note that the `osx_rpath_install_name` option here is a hack
414416 // purely to support bootstrap right now, we should get a more
415417 // principled solution at some point to force the compiler to pass
You can’t perform that action at this time.
0 commit comments