Skip to content

Commit

Permalink
rust: disable stack probes
Browse files Browse the repository at this point in the history
We do not support function-call stack probes, and LLVM inline asm
stack probe is currently broken [1][2]. Switching target's `stack-probes`
to "none" allows us to avoid broken codegen and the intrinsic call.
We could switch the `stack-probes` property to `inline` if we want once
the LLVM codegen issue is resolved.

[1]: https://bugs.llvm.org/show_bug.cgi?id=50165
[2]: rust-lang/rust#84667

Signed-off-by: Gary Guo <gary@garyguo.net>
  • Loading branch information
nbdd0121 committed Jun 6, 2021
1 parent bfe9ec6 commit 12088f5
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 40 deletions.
7 changes: 1 addition & 6 deletions arch/arm64/rust/target.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@
"relocation-model": "static",
"relro-level": "full",
"stack-probes": {
"kind": "inline-or-call",
"min-llvm-version-for-inline": [
11,
0,
1
]
"kind": "none"
},
"target-c-int-width": "32",
"target-endian": "little",
Expand Down
7 changes: 1 addition & 6 deletions arch/riscv/rust/rv32ima.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@
"relocation-model": "static",
"relro-level": "full",
"stack-probes": {
"kind": "inline-or-call",
"min-llvm-version-for-inline": [
11,
0,
1
]
"kind": "none"
},
"target-c-int-width": "32",
"target-endian": "little",
Expand Down
7 changes: 1 addition & 6 deletions arch/riscv/rust/rv32imac.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@
"relocation-model": "static",
"relro-level": "full",
"stack-probes": {
"kind": "inline-or-call",
"min-llvm-version-for-inline": [
11,
0,
1
]
"kind": "none"
},
"target-c-int-width": "32",
"target-endian": "little",
Expand Down
7 changes: 1 addition & 6 deletions arch/riscv/rust/rv64ima.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@
"relocation-model": "static",
"relro-level": "full",
"stack-probes": {
"kind": "inline-or-call",
"min-llvm-version-for-inline": [
11,
0,
1
]
"kind": "none"
},
"target-c-int-width": "32",
"target-endian": "little",
Expand Down
7 changes: 1 addition & 6 deletions arch/riscv/rust/rv64imac.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@
"relocation-model": "static",
"relro-level": "full",
"stack-probes": {
"kind": "inline-or-call",
"min-llvm-version-for-inline": [
11,
0,
1
]
"kind": "none"
},
"target-c-int-width": "32",
"target-endian": "little",
Expand Down
7 changes: 1 addition & 6 deletions arch/x86/rust/target.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@
"relocation-model": "static",
"relro-level": "full",
"stack-probes": {
"kind": "inline-or-call",
"min-llvm-version-for-inline": [
11,
0,
1
]
"kind": "none"
},
"target-c-int-width": "32",
"target-endian": "little",
Expand Down
4 changes: 0 additions & 4 deletions rust/compiler_builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ macro_rules! define_panicking_intrinsics(
}
);

define_panicking_intrinsics!("non-inline stack probes should not be used", {
__rust_probestack,
});

define_panicking_intrinsics!("`f32` should not be used", {
__addsf3,
__addsf3vfp,
Expand Down

0 comments on commit 12088f5

Please sign in to comment.