From: Debian Rust Maintainers Date: Fri, 2 Nov 2018 08:42:36 +0000 (+0000) Subject: d-add-soname X-Git-Tag: archive/raspbian/1.30.0+dfsg1-2+rpi1~1^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1cab8f401af32efebdd0f4a712b039464058cbc8;p=rustc.git d-add-soname Gbp-Pq: Name d-add-soname.patch --- diff --git a/src/librustc_codegen_llvm/back/link.rs b/src/librustc_codegen_llvm/back/link.rs index 8248385c12..2755e947b0 100644 --- a/src/librustc_codegen_llvm/back/link.rs +++ b/src/librustc_codegen_llvm/back/link.rs @@ -1222,6 +1222,13 @@ fn link_args(cmd: &mut dyn Linker, cmd.args(&rpath::get_rpath_flags(&mut rpath_config)); } + if (crate_type == config::CrateType::Dylib || crate_type == config::CrateType::Cdylib) + && t.options.linker_is_gnu { + let filename = String::from(out_filename.file_name().unwrap().to_str().unwrap()); + let soname = [String::from("-Wl,-soname=") + &filename]; + cmd.args(&soname); + } + // Finally add all the linker arguments provided on the command line along // with any #[link_args] attributes found inside the crate if let Some(ref args) = sess.opts.cg.link_args {