diff options
| author | bors <bors@rust-lang.org> | 2021-06-26 19:20:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-06-26 19:20:41 +0000 |
| commit | a1411de9de38e0fed728874580218338160eb185 (patch) | |
| tree | d7f83b23ca8424719e72891d67bf6b3dc5ad8e03 /library/std/src/sys/unix/stack_overflow.rs | |
| parent | 3ddb78a34608848a60f6ca5b6ccfde8340302372 (diff) | |
| parent | abdd24a0404e2ce7c879297da4aa66cf4e64ab79 (diff) | |
| download | rust-a1411de9de38e0fed728874580218338160eb185.tar.gz rust-a1411de9de38e0fed728874580218338160eb185.zip | |
Auto merge of #86267 - ZuseZ4:master, r=nagisa
Allow loading of llvm plugins on nightly
Based on a discussion in #82734 / with `@wsmoses.`
Mainly moves [this](https://github.com/wsmoses/rust/commit/0149bc4e7e596005c665b132877abebe5258a0f6) behind a -Z flag, so it can only be used on nightly,
as requested by `@nagisa` in https://github.com/rust-lang/rust/issues/82734#issuecomment-835863940
This change allows loading of llvm plugins like Enzyme.
Right now it also requires a shared library LLVM build of rustc for symbol resolution.
```rust
// test.rs
extern { fn __enzyme_autodiff(_: usize, ...) -> f64; }
fn square(x : f64) -> f64 {
return x * x;
}
fn main() {
unsafe {
println!("Hello, world {} {}!", square(3.0), __enzyme_autodiff(square as usize, 3.0));
}
}
```
```
./rustc test.rs -Z llvm-plugins="./LLVMEnzyme-12.so" -C passes="enzyme"
./test
Hello, world 9 6!
```
I will try to figure out how to simplify the usage and get this into stable in a later iteration,
but having this on nightly will already help testing further steps.
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
