about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift
diff options
context:
space:
mode:
authorFolkert de Vries <folkert@folkertdev.nl>2025-05-07 20:02:29 +0200
committerFolkert de Vries <folkert@folkertdev.nl>2025-06-12 20:27:10 +0200
commit5f73ce2b7ebfc0234a4bc736217110a2af1e2380 (patch)
treeebc007a2643f2ab9d875026e22478682735f908f /compiler/rustc_codegen_cranelift
parent0a39445252ac076ef573bcacee63bbdc59497b52 (diff)
downloadrust-5f73ce2b7ebfc0234a4bc736217110a2af1e2380.tar.gz
rust-5f73ce2b7ebfc0234a4bc736217110a2af1e2380.zip
add `extern "custom"` functions
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
-rw-r--r--compiler/rustc_codegen_cranelift/src/abi/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/abi/mod.rs b/compiler/rustc_codegen_cranelift/src/abi/mod.rs
index fe5b220117f..4c6fd907815 100644
--- a/compiler/rustc_codegen_cranelift/src/abi/mod.rs
+++ b/compiler/rustc_codegen_cranelift/src/abi/mod.rs
@@ -51,6 +51,11 @@ pub(crate) fn conv_to_call_conv(
         CanonAbi::Rust | CanonAbi::C => default_call_conv,
         CanonAbi::RustCold => CallConv::Cold,
 
+        // Functions with this calling convention can only be called from assembly, but it is
+        // possible to declare an `extern "custom"` block, so the backend still needs a calling
+        // convention for declaring foreign functions.
+        CanonAbi::Custom => default_call_conv,
+
         CanonAbi::X86(x86_call) => match x86_call {
             X86Call::SysV64 => CallConv::SystemV,
             X86Call::Win64 => CallConv::WindowsFastcall,