@@ -225,6 +225,7 @@ use metadata::filesearch::{FileSearch, FileMatches, FileDoesntMatch};
225225use syntax:: codemap:: Span ;
226226use syntax:: diagnostic:: SpanHandler ;
227227use util:: fs;
228+ use rustc_back:: target:: Target ;
228229
229230use std:: ffi:: CString ;
230231use std:: cmp;
@@ -248,6 +249,8 @@ pub struct Context<'a> {
248249 pub ident : & ' a str ,
249250 pub crate_name : & ' a str ,
250251 pub hash : Option < & ' a Svh > ,
252+ // points to either self.sess.target.target or self.sess.host, must match triple
253+ pub target : & ' a Target ,
251254 pub triple : & ' a str ,
252255 pub filesearch : FileSearch < ' a > ,
253256 pub root : & ' a Option < CratePaths > ,
@@ -499,7 +502,7 @@ impl<'a> Context<'a> {
499502
500503 for lib in m. into_iter ( ) {
501504 info ! ( "{} reading metadata from: {}" , flavor, lib. display( ) ) ;
502- let metadata = match get_metadata_section ( self . sess . target . target . options . is_like_osx ,
505+ let metadata = match get_metadata_section ( self . target . options . is_like_osx ,
503506 & lib) {
504507 Ok ( blob) => {
505508 if self . crate_matches ( blob. as_slice ( ) , & lib) {
@@ -588,7 +591,7 @@ impl<'a> Context<'a> {
588591 // Returns the corresponding (prefix, suffix) that files need to have for
589592 // dynamic libraries
590593 fn dylibname ( & self ) -> ( String , String ) {
591- let t = & self . sess . target . target ;
594+ let t = & self . target ;
592595 ( t. options . dll_prefix . clone ( ) , t. options . dll_suffix . clone ( ) )
593596 }
594597
0 commit comments