Skip to content

Commit 74eaf2a

Browse files
authored
Unrolled build for #141992
Rollup merge of #141992 - folkertdev:probestack-naked-function, r=tgross35 use `#[naked]` for `__rust_probestack` Let's see if this works now. Previously this change was in rust-lang/compiler-builtins#897, but we decided to wait until `compiler-builtins` was a subtree (and also `cfg(bootstrap)` is gone now). r? ``@tgross35`` cc ``@bjorn3`` try-job: `dist-various*` try-job: `test-various*`
2 parents c6a9554 + b030442 commit 74eaf2a

File tree

3 files changed

+171
-275
lines changed

3 files changed

+171
-275
lines changed

compiler/rustc_codegen_llvm/src/attributes.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use rustc_hir::def_id::DefId;
55
use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, PatchableFunctionEntry};
66
use rustc_middle::ty::{self, TyCtxt};
77
use rustc_session::config::{BranchProtection, FunctionReturn, OptLevel, PAuthKey, PacRet};
8+
use rustc_symbol_mangling::mangle_internal_symbol;
89
use rustc_target::spec::{FramePointer, SanitizerSet, StackProbeType, StackProtector};
910
use smallvec::SmallVec;
1011

@@ -256,11 +257,11 @@ fn probestack_attr<'ll>(cx: &CodegenCx<'ll, '_>) -> Option<&'ll Attribute> {
256257
StackProbeType::Inline => "inline-asm",
257258
// Flag our internal `__rust_probestack` function as the stack probe symbol.
258259
// This is defined in the `compiler-builtins` crate for each architecture.
259-
StackProbeType::Call => "__rust_probestack",
260+
StackProbeType::Call => &mangle_internal_symbol(cx.tcx, "__rust_probestack"),
260261
// Pick from the two above based on the LLVM version.
261262
StackProbeType::InlineOrCall { min_llvm_version_for_inline } => {
262263
if llvm_util::get_version() < min_llvm_version_for_inline {
263-
"__rust_probestack"
264+
&mangle_internal_symbol(cx.tcx, "__rust_probestack")
264265
} else {
265266
"inline-asm"
266267
}

library/compiler-builtins/compiler-builtins/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#![feature(linkage)]
99
#![feature(naked_functions)]
1010
#![feature(repr_simd)]
11+
#![feature(rustc_attrs)]
1112
#![cfg_attr(f16_enabled, feature(f16))]
1213
#![cfg_attr(f128_enabled, feature(f128))]
1314
#![no_builtins]

0 commit comments

Comments
 (0)