From: Rust Maintainers Date: Mon, 1 Jan 2018 13:27:19 +0000 (+0000) Subject: d-add-soname X-Git-Tag: archive/raspbian/1.22.1+dfsg1-2+rpi1^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f44eb4d5fd9ab5df71bf4d0311bb671d3ec06962;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 3f25c182fa..a6f80c3ca8 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -1034,6 +1034,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 {