From 092643a2665f807ab045a533c04785f4f37d2d7d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 23 Feb 2021 21:38:49 +0100 Subject: [PATCH] Explicitly mark x86-interrupt ABI argument as byval The first argument to an x86-interrupt ABI function was implicitly treated as byval prior to LLVM 12. Since LLVM 12, it has to be marked as such explicitly: https://github.com/llvm/llvm-project/commit/2e0e03c6a089da39039ec3f464f7cee5df86646b --- compiler/rustc_target/src/abi/call/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs index 9c49922c286..0deb1186b0f 100644 --- a/compiler/rustc_target/src/abi/call/mod.rs +++ b/compiler/rustc_target/src/abi/call/mod.rs @@ -603,6 +603,13 @@ impl<'a, Ty> FnAbi<'a, Ty> { Ty: TyAndLayoutMethods<'a, C> + Copy, C: LayoutOf> + HasDataLayout + HasTargetSpec, { + if abi == spec::abi::Abi::X86Interrupt { + if let Some(arg) = self.args.first_mut() { + arg.make_indirect_byval(); + } + return Ok(()); + } + match &cx.target_spec().arch[..] { "x86" => { let flavor = if abi == spec::abi::Abi::Fastcall {