@@ -225,6 +225,7 @@ use metadata::filesearch::{FileSearch, FileMatches, FileDoesntMatch};
225
225
use syntax:: codemap:: Span ;
226
226
use syntax:: diagnostic:: SpanHandler ;
227
227
use util:: fs;
228
+ use rustc_back:: target:: Target ;
228
229
229
230
use std:: ffi:: CString ;
230
231
use std:: cmp;
@@ -248,6 +249,8 @@ pub struct Context<'a> {
248
249
pub ident : & ' a str ,
249
250
pub crate_name : & ' a str ,
250
251
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 ,
251
254
pub triple : & ' a str ,
252
255
pub filesearch : FileSearch < ' a > ,
253
256
pub root : & ' a Option < CratePaths > ,
@@ -499,7 +502,7 @@ impl<'a> Context<'a> {
499
502
500
503
for lib in m. into_iter ( ) {
501
504
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 ,
503
506
& lib) {
504
507
Ok ( blob) => {
505
508
if self . crate_matches ( blob. as_slice ( ) , & lib) {
@@ -588,7 +591,7 @@ impl<'a> Context<'a> {
588
591
// Returns the corresponding (prefix, suffix) that files need to have for
589
592
// dynamic libraries
590
593
fn dylibname ( & self ) -> ( String , String ) {
591
- let t = & self . sess . target . target ;
594
+ let t = & self . target ;
592
595
( t. options . dll_prefix . clone ( ) , t. options . dll_suffix . clone ( ) )
593
596
}
594
597
0 commit comments