diff options
| author | bors <bors@rust-lang.org> | 2023-11-30 22:10:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-11-30 22:10:30 +0000 |
| commit | f45631b10f2199a7ef344a936af9eb60342c16ee (patch) | |
| tree | db7948a73b1bd350c06116e79d4168749dc3e41a /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | 87e1447aadaa2899ff6ccabe1fa669eb50fb60a1 (diff) | |
| parent | 2d476222e8458aa873e6760aac189b5e9d0a9930 (diff) | |
| download | rust-f45631b10f2199a7ef344a936af9eb60342c16ee.tar.gz rust-f45631b10f2199a7ef344a936af9eb60342c16ee.zip | |
Auto merge of #116892 - ojeda:rethunk, r=wesleywiser
Add `-Zfunction-return={keep,thunk-extern}` option
This is intended to be used for Linux kernel RETHUNK builds.
With this commit (optionally backported to Rust 1.73.0), plus a patched Linux kernel to pass the flag, I get a RETHUNK build with Rust enabled that is `objtool`-warning-free and is able to boot in QEMU and load a sample Rust kernel module.
Issue: https://github.com/rust-lang/rust/issues/116853.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index bf870e28acd..b227dd76f02 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -278,6 +278,8 @@ static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) { return Attribute::AllocAlign; case SanitizeSafeStack: return Attribute::SafeStack; + case FnRetThunkExtern: + return Attribute::FnRetThunkExtern; } report_fatal_error("bad AttributeKind"); } |
