@@ -375,16 +375,19 @@ to Miri failing to detect cases of undefined behavior in a program.
375
375
* `-Zmiri-disable-weak-memory-emulation` disables the emulation of some C++11 weak
376
376
memory effects.
377
377
* `-Zmiri-native-lib=<path to a shared object file>` is an experimental flag for providing support
378
- for calling native functions from inside the interpreter via FFI. Functions not provided by that
379
- file are still executed via the usual Miri shims.
380
- **WARNING**: If an invalid/incorrect `.so` file is specified, this can cause Undefined Behavior in Miri itself!
381
- And of course, Miri cannot do any checks on the actions taken by the native code.
382
- Note that Miri has its own handling of file descriptors, so if you want to replace *some* functions
383
- working on file descriptors, you will have to replace *all* of them, or the two kinds of
384
- file descriptors will be mixed up.
385
- This is **work in progress**; currently, only integer arguments and return values are
386
- supported (and no, pointer/integer casts to work around this limitation will not work;
387
- they will fail horribly). It also only works on Unix hosts for now.
378
+ for calling native functions from inside the interpreter via FFI. The flag is supported only on
379
+ Unix systems. Functions not provided by that file are still executed via the usual Miri shims.
380
+ **WARNING**: If an invalid/incorrect `.so` file is specified, this can cause Undefined Behavior in
381
+ Miri itself! And of course, Miri cannot do any checks on the actions taken by the native code.
382
+ Note that Miri has its own handling of file descriptors, so if you want to replace *some*
383
+ functions working on file descriptors, you will have to replace *all* of them, or the two kinds of
384
+ file descriptors will be mixed up. This is **work in progress**; currently, only integer and
385
+ pointers arguments and return values are supported and memory allocated by the native code cannot
386
+ be accessed from Rust (only the other way around). Native code must not spawn threads that keep
387
+ running in the background after the call has returned to Rust and that access Rust-allocated
388
+ memory. Finally, the flag is **unsound** in the sense that Miri stops tracking details such as
389
+ initialization and provenance on memory shared with native code, so it is easily possible to write
390
+ code that has UB which is missed by Miri.
388
391
* `-Zmiri-measureme=<name>` enables `measureme` profiling for the interpreted program.
389
392
This can be used to find which parts of your program are executing slowly under Miri.
390
393
The profile is written out to a file inside a directory called `<name>`, and can be processed
0 commit comments