Skip to content

Commit c794dc7

Browse files
committed
Enable inline stack probes on riscv64
Fixes #1358
1 parent 98ddd69 commit c794dc7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,17 @@ fn build_isa(sess: &Session, backend_config: &BackendConfig) -> Box<dyn isa::Tar
280280
}
281281
}
282282

283-
if let target_lexicon::Architecture::Aarch64(_) | target_lexicon::Architecture::X86_64 =
284-
target_triple.architecture
283+
if let target_lexicon::Architecture::Aarch64(_)
284+
| target_lexicon::Architecture::Riscv64(_)
285+
| target_lexicon::Architecture::X86_64 = target_triple.architecture
285286
{
286-
// Windows depends on stack probes to grow the committed part of the stack
287+
// Windows depends on stack probes to grow the committed part of the stack.
288+
// On other platforms it helps prevents stack smashing.
287289
flags_builder.enable("enable_probestack").unwrap();
288290
flags_builder.set("probestack_strategy", "inline").unwrap();
289291
} else {
290-
// __cranelift_probestack is not provided and inline stack probes are only supported on AArch64 and x86_64
292+
// __cranelift_probestack is not provided and inline stack probes are only supported on
293+
// AArch64, Riscv64 and x86_64.
291294
flags_builder.set("enable_probestack", "false").unwrap();
292295
}
293296

0 commit comments

Comments
 (0)