Use probe-stack=inline-asm in LLVM 11+
This commit is contained in:
@@ -127,13 +127,18 @@ fn set_probestack(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Flag our internal `__rust_probestack` function as the stack probe symbol.
|
||||
// This is defined in the `compiler-builtins` crate for each architecture.
|
||||
llvm::AddFunctionAttrStringValue(
|
||||
llfn,
|
||||
llvm::AttributePlace::Function,
|
||||
const_cstr!("probe-stack"),
|
||||
const_cstr!("__rust_probestack"),
|
||||
if llvm_util::get_version() < (11, 0, 1) {
|
||||
// Flag our internal `__rust_probestack` function as the stack probe symbol.
|
||||
// This is defined in the `compiler-builtins` crate for each architecture.
|
||||
const_cstr!("__rust_probestack")
|
||||
} else {
|
||||
// On LLVM 11+, emit inline asm for stack probes instead of a function call.
|
||||
const_cstr!("inline-asm")
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user