From: Debian Rust Maintainers Date: Sun, 23 Sep 2018 17:16:53 +0000 (+0100) Subject: d-add-soname X-Git-Tag: archive/raspbian/1.29.0+dfsg1-1+rpi1~1^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c81148567a381b7951764344a6ba534be6ec7a28;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 845a66c6e4..10945891a4 100644 --- a/src/librustc_codegen_llvm/back/link.rs +++ b/src/librustc_codegen_llvm/back/link.rs @@ -1181,6 +1181,13 @@ fn link_args(cmd: &mut dyn Linker, cmd.args(&rpath::get_rpath_flags(&mut rpath_config)); } + if (crate_type == config::CrateTypeDylib || crate_type == config::CrateTypeCdylib) + && 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 {