Skip to content

Commit 516519e

Browse files
Allow specification of the system V AMD64 ABI constraint.
This can be specified using `extern sysV64 fn` on all platforms
1 parent 71ee82a commit 516519e

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

src/doc/book/ffi.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ This is currently hidden behind the `abi_vectorcall` gate and is subject to chan
539539
* `system`
540540
* `C`
541541
* `win64`
542+
* `sysV64`
542543

543544
Most of the abis in this list are self-explanatory, but the `system` abi may
544545
seem a little odd. This constraint selects whatever the appropriate ABI is for

src/librustc_llvm/ffi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ pub enum CallConv {
4242
ColdCallConv = 9,
4343
X86StdcallCallConv = 64,
4444
X86FastcallCallConv = 65,
45+
X86_64_SysV = 78,
4546
X86_64_Win64 = 79,
4647
X86_VectorCall = 80
4748
}

src/librustc_trans/abi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ impl FnType {
269269
Vectorcall => llvm::X86_VectorCall,
270270
C => llvm::CCallConv,
271271
Win64 => llvm::X86_64_Win64,
272+
SysV64 => llvm::X86_64_SysV,
272273

273274
// These API constants ought to be more specific...
274275
Cdecl => llvm::CCallConv,

src/libsyntax/abi.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ pub enum Abi {
3939
Vectorcall,
4040
Aapcs,
4141
Win64,
42+
SysV64,
4243

4344
// Multiplatform ABIs second
4445
Rust,
@@ -86,6 +87,7 @@ const AbiDatas: &'static [AbiData] = &[
8687
AbiData {abi: Abi::Vectorcall, name: "vectorcall"},
8788
AbiData {abi: Abi::Aapcs, name: "aapcs" },
8889
AbiData {abi: Abi::Win64, name: "win64" },
90+
AbiData {abi: Abi::SysV64, name: "sysV64" },
8991

9092
// Cross-platform ABIs
9193
//

0 commit comments

Comments
 (0)