From: Rust Maintainers Date: Wed, 9 Aug 2017 02:49:55 +0000 (+0100) Subject: d-add-soname X-Git-Tag: archive/raspbian/1.19.0+dfsg3-4+rpi1^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=662a6e7ba170007f27a45ea6a27c03d7ca8261bb;p=rustc.git d-add-soname Gbp-Pq: Name d-add-soname.patch --- diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs index 7c0522a9c8..40768a21cc 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -998,6 +998,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 {