From: Debian Rust Maintainers Date: Sun, 5 Aug 2018 09:18:10 +0000 (+0100) Subject: d-add-soname X-Git-Tag: archive/raspbian/1.28.0+dfsg1-2+rpi1^2~9 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=587f80d270727c820d85d7adc0af9813e2e7d0c5;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 4e9910e58f..5519eb82d2 100644 --- a/src/librustc_codegen_llvm/back/link.rs +++ b/src/librustc_codegen_llvm/back/link.rs @@ -1174,6 +1174,13 @@ fn link_args(cmd: &mut 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 {