@@ -400,6 +400,7 @@ pub struct MiriMachine<'mir, 'tcx> {
400
400
pub ( crate ) basic_block_count : u64 ,
401
401
402
402
/// Handle of the optional shared object file for external functions.
403
+ #[ cfg( unix) ]
403
404
pub external_so_lib : Option < ( libloading:: Library , std:: path:: PathBuf ) > ,
404
405
405
406
/// Run a garbage collector for SbTags every N basic blocks.
@@ -410,7 +411,6 @@ pub struct MiriMachine<'mir, 'tcx> {
410
411
411
412
impl < ' mir , ' tcx > MiriMachine < ' mir , ' tcx > {
412
413
pub ( crate ) fn new ( config : & MiriConfig , layout_cx : LayoutCx < ' tcx , TyCtxt < ' tcx > > ) -> Self {
413
- let target_triple = & layout_cx. tcx . sess . opts . target_triple . to_string ( ) ;
414
414
let local_crates = helpers:: get_local_crates ( layout_cx. tcx ) ;
415
415
let layouts =
416
416
PrimitiveLayouts :: new ( layout_cx) . expect ( "Couldn't get layouts of primitive types" ) ;
@@ -462,7 +462,9 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
462
462
report_progress : config. report_progress ,
463
463
basic_block_count : 0 ,
464
464
clock : Clock :: new ( config. isolated_op == IsolatedOp :: Allow ) ,
465
+ #[ cfg( unix) ]
465
466
external_so_lib : config. external_so_file . as_ref ( ) . map ( |lib_file_path| {
467
+ let target_triple = & layout_cx. tcx . sess . opts . target_triple . to_string ( ) ;
466
468
// Check if host target == the session target.
467
469
if env ! ( "TARGET" ) != target_triple {
468
470
panic ! (
0 commit comments