From: Rust Maintainers Date: Sun, 15 Oct 2017 21:30:35 +0000 (+0100) Subject: d-add-soname X-Git-Tag: archive/raspbian/1.20.0+dfsg1-1+rpi1^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fa73d729e8a02bcb3095e65b0cea6d9f9aba612a;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 6cbdae7627..58aa8da1dd 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -1105,6 +1105,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 {