diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-06-13 05:19:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-13 05:19:14 +0200 |
| commit | 7c3b2e52543a5e1cc912b1ab4fee8fe381e783a9 (patch) | |
| tree | 9921d18c60395765a46d3d4c556faac53a98bbdb /compiler/rustc_codegen_llvm/src/llvm/mod.rs | |
| parent | 1a865fbe4e3bf3fa94cdc425c26ca919c6f8288f (diff) | |
| parent | 5f73ce2b7ebfc0234a4bc736217110a2af1e2380 (diff) | |
| download | rust-7c3b2e52543a5e1cc912b1ab4fee8fe381e783a9.tar.gz rust-7c3b2e52543a5e1cc912b1ab4fee8fe381e783a9.zip | |
Rollup merge of #140770 - folkertdev:custom-abi, r=tgross35
add `extern "custom"` functions
tracking issue: rust-lang/rust#140829
previous discussion: https://github.com/rust-lang/rust/issues/140566
In short, an `extern "custom"` function is a function with a custom ABI, that rust does not know about. Therefore, such functions can only be defined with `#[unsafe(naked)]` and `naked_asm!`, or via an `extern "C" { /* ... */ }` block. These functions cannot be called using normal rust syntax: calling them can only be done from inline assembly.
The motivation is low-level scenarios where a custom calling convention is used. Currently, we often pick `extern "C"`, but that is a lie because the function does not actually respect the C calling convention.
At the moment `"custom"` seems to be the name with the most support. That name is not final, but we need to pick something to actually implement this.
r? `@traviscross`
cc `@tgross35`
try-job: x86_64-apple-2
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/mod.rs')
0 files changed, 0 insertions, 0 deletions
