11//! Implements calling functions from a native library.
22
3- #[ cfg( target_os = "linux" ) ]
4- pub mod trace;
3+ // FIXME: disabled since it fails to build on many targets.
4+ //#[cfg(target_os = "linux")]
5+ //pub mod trace;
56
67use std:: ops:: Deref ;
78
@@ -12,13 +13,13 @@ use rustc_middle::mir::interpret::Pointer;
1213use rustc_middle:: ty:: { self as ty, IntTy , UintTy } ;
1314use rustc_span:: Symbol ;
1415
15- #[ cfg( target_os = "linux" ) ]
16- use self :: trace:: Supervisor ;
16+ // #[cfg(target_os = "linux")]
17+ // use self::trace::Supervisor;
1718use crate :: * ;
1819
19- #[ cfg( target_os = "linux" ) ]
20- type CallResult < ' tcx > = InterpResult < ' tcx , ( ImmTy < ' tcx > , Option < self :: trace:: messages:: MemEvents > ) > ;
21- #[ cfg( not( target_os = "linux" ) ) ]
20+ // #[cfg(target_os = "linux")]
21+ // type CallResult<'tcx> = InterpResult<'tcx, (ImmTy<'tcx>, Option<self::trace::messages::MemEvents>)>;
22+ // #[cfg(not(target_os = "linux"))]
2223type CallResult < ' tcx > = InterpResult < ' tcx , ( ImmTy < ' tcx > , Option < !> ) > ;
2324
2425impl < ' tcx > EvalContextExtPriv < ' tcx > for crate :: MiriInterpCx < ' tcx > { }
@@ -32,12 +33,12 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
3233 libffi_args : Vec < libffi:: high:: Arg < ' a > > ,
3334 ) -> CallResult < ' tcx > {
3435 let this = self . eval_context_mut ( ) ;
35- #[ cfg( target_os = "linux" ) ]
36- let alloc = this. machine . allocator . as_ref ( ) . unwrap ( ) ;
36+ // #[cfg(target_os = "linux")]
37+ // let alloc = this.machine.allocator.as_ref().unwrap();
3738
3839 // SAFETY: We don't touch the machine memory past this point.
39- #[ cfg( target_os = "linux" ) ]
40- let ( guard, stack_ptr) = unsafe { Supervisor :: start_ffi ( alloc) } ;
40+ // #[cfg(target_os = "linux")]
41+ // let (guard, stack_ptr) = unsafe { Supervisor::start_ffi(alloc) };
4142
4243 // Call the function (`ptr`) with arguments `libffi_args`, and obtain the return value
4344 // as the specified primitive integer type
@@ -111,9 +112,9 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
111112
112113 // SAFETY: We got the guard and stack pointer from start_ffi, and
113114 // the allocator is the same
114- #[ cfg( target_os = "linux" ) ]
115- let events = unsafe { Supervisor :: end_ffi ( alloc, guard, stack_ptr) } ;
116- #[ cfg( not( target_os = "linux" ) ) ]
115+ // #[cfg(target_os = "linux")]
116+ // let events = unsafe { Supervisor::end_ffi(alloc, guard, stack_ptr) };
117+ // #[cfg(not(target_os = "linux"))]
117118 let events = None ;
118119
119120 interp_ok ( ( res?, events) )
@@ -213,9 +214,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
213214 if !this. machine . native_call_mem_warned . replace ( true ) {
214215 // Newly set, so first time we get here.
215216 this. emit_diagnostic ( NonHaltingDiagnostic :: NativeCallSharedMem {
216- #[ cfg( target_os = "linux" ) ]
217- tracing : self :: trace:: Supervisor :: is_enabled ( ) ,
218- #[ cfg( not( target_os = "linux" ) ) ]
217+ // #[cfg(target_os = "linux")]
218+ // tracing: self::trace::Supervisor::is_enabled(),
219+ // #[cfg(not(target_os = "linux"))]
219220 tracing : false ,
220221 } ) ;
221222 }
0 commit comments