diff options
| author | kennytm <kennytm@gmail.com> | 2018-11-24 01:31:59 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-24 01:31:59 +0800 |
| commit | c9870a4fe7c22e5dee456b6a60f33b492466d2ea (patch) | |
| tree | 828499d50bb6cf421c4862986590a087deb3c0ff /src/librustc_codegen_llvm | |
| parent | bf72971abc0155d4f71c2127e7122df64a9cd699 (diff) | |
| parent | f41423c75f929bfad12846e64db174621a238d74 (diff) | |
| download | rust-c9870a4fe7c22e5dee456b6a60f33b492466d2ea.tar.gz rust-c9870a4fe7c22e5dee456b6a60f33b492466d2ea.zip | |
Rollup merge of #56154 - petrhosek:fuchsia-linker-args, r=alexcrichton
Pass additional linker flags when targeting Fuchsia This is a follow up to 8aa9267 which changed the driver to use lld directly rather than invoking it through Clang. This change ensures we pass all the necessary flags to lld.
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/back/link.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/back/link.rs b/src/librustc_codegen_llvm/back/link.rs index 20f05d11087..8380b713621 100644 --- a/src/librustc_codegen_llvm/back/link.rs +++ b/src/librustc_codegen_llvm/back/link.rs @@ -19,7 +19,7 @@ use super::rpath::RPathConfig; use super::rpath; use metadata::METADATA_FILENAME; use rustc::session::config::{self, DebugInfo, OutputFilenames, OutputType, PrintRequest}; -use rustc::session::config::{RUST_CGU_EXT, Lto}; +use rustc::session::config::{RUST_CGU_EXT, Lto, Sanitizer}; use rustc::session::filesearch; use rustc::session::search_paths::PathKind; use rustc::session::Session; @@ -491,6 +491,14 @@ fn link_natively(sess: &Session, } cmd.args(&sess.opts.debugging_opts.pre_link_arg); + if sess.target.target.options.is_like_fuchsia { + let prefix = match sess.opts.debugging_opts.sanitizer { + Some(Sanitizer::Address) => "asan/", + _ => "", + }; + cmd.arg(format!("--dynamic-linker={}ld.so.1", prefix)); + } + let pre_link_objects = if crate_type == config::CrateType::Executable { &sess.target.target.options.pre_link_objects_exe } else { |
