@@ -421,8 +421,10 @@ pub struct MiriMachine<'mir, 'tcx> {
421421 pub ( crate ) basic_block_count : u64 ,
422422
423423 /// Handle of the optional shared object file for external functions.
424- #[ cfg( unix ) ]
424+ #[ cfg( target_os = "linux" ) ]
425425 pub external_so_lib : Option < ( libloading:: Library , std:: path:: PathBuf ) > ,
426+ #[ cfg( not( target_os = "linux" ) ) ]
427+ pub external_so_lib : Option < !> ,
426428
427429 /// Run a garbage collector for SbTags every N basic blocks.
428430 pub ( crate ) gc_interval : u32 ,
@@ -485,7 +487,7 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
485487 report_progress : config. report_progress ,
486488 basic_block_count : 0 ,
487489 clock : Clock :: new ( config. isolated_op == IsolatedOp :: Allow ) ,
488- #[ cfg( unix ) ]
490+ #[ cfg( target_os = "linux" ) ]
489491 external_so_lib : config. external_so_file . as_ref ( ) . map ( |lib_file_path| {
490492 let target_triple = layout_cx. tcx . sess . opts . target_triple . triple ( ) ;
491493 // Check if host target == the session target.
@@ -507,6 +509,10 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
507509 lib_file_path. clone ( ) ,
508510 )
509511 } ) ,
512+ #[ cfg( not( target_os = "linux" ) ) ]
513+ external_so_lib : config. external_so_file . as_ref ( ) . map ( |_| {
514+ panic ! ( "loading external .so files is only supported on Linux" )
515+ } ) ,
510516 gc_interval : config. gc_interval ,
511517 since_gc : 0 ,
512518 num_cpus : config. num_cpus ,
@@ -648,7 +654,6 @@ impl VisitTags for MiriMachine<'_, '_> {
648654 preemption_rate : _,
649655 report_progress : _,
650656 basic_block_count : _,
651- #[ cfg( unix) ]
652657 external_so_lib : _,
653658 gc_interval : _,
654659 since_gc : _,
0 commit comments