From 53bc4d452e2f35432bec98ec602ce547e766b3a0 Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Sun, 6 Jun 2021 05:34:45 +0100 Subject: [PATCH] rust: disable stack probes 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]: https://github.com/rust-lang/rust/issues/84667 Signed-off-by: Gary Guo --- arch/arm64/rust/target.json | 7 +------ arch/riscv/rust/rv32ima.json | 7 +------ arch/riscv/rust/rv32imac.json | 7 +------ arch/riscv/rust/rv64ima.json | 7 +------ arch/riscv/rust/rv64imac.json | 7 +------ arch/x86/rust/target.json | 7 +------ rust/compiler_builtins.rs | 4 ---- 7 files changed, 6 insertions(+), 40 deletions(-) diff --git a/arch/arm64/rust/target.json b/arch/arm64/rust/target.json index 44953e2725c4a7..9ea86ed6c736c2 100644 --- a/arch/arm64/rust/target.json +++ b/arch/arm64/rust/target.json @@ -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", diff --git a/arch/riscv/rust/rv32ima.json b/arch/riscv/rust/rv32ima.json index ce0bc736f289a6..8e9b46011e7c98 100644 --- a/arch/riscv/rust/rv32ima.json +++ b/arch/riscv/rust/rv32ima.json @@ -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", diff --git a/arch/riscv/rust/rv32imac.json b/arch/riscv/rust/rv32imac.json index 245a46ef493694..2b3a139da999f4 100644 --- a/arch/riscv/rust/rv32imac.json +++ b/arch/riscv/rust/rv32imac.json @@ -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", diff --git a/arch/riscv/rust/rv64ima.json b/arch/riscv/rust/rv64ima.json index c50094be3fa116..091da50069a31b 100644 --- a/arch/riscv/rust/rv64ima.json +++ b/arch/riscv/rust/rv64ima.json @@ -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", diff --git a/arch/riscv/rust/rv64imac.json b/arch/riscv/rust/rv64imac.json index 84fd03ed38e952..aa5a8f4549f1e6 100644 --- a/arch/riscv/rust/rv64imac.json +++ b/arch/riscv/rust/rv64imac.json @@ -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", diff --git a/arch/x86/rust/target.json b/arch/x86/rust/target.json index 6e1759cd45bf56..76ac800d38efb2 100644 --- a/arch/x86/rust/target.json +++ b/arch/x86/rust/target.json @@ -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", diff --git a/rust/compiler_builtins.rs b/rust/compiler_builtins.rs index 58d1a9b4d21823..fbb85b919d74b6 100644 --- a/rust/compiler_builtins.rs +++ b/rust/compiler_builtins.rs @@ -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,