about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCensoredUsername <cens.username@gmail.com>2016-06-27 02:34:02 +0200
committerCensoredUsername <cens.username@gmail.com>2016-08-30 16:01:40 +0200
commit516519ee9af3235d5a5ed9bb7afa5bb1a27a8ddf (patch)
treef8b68381064b0bb81702df9c5d6d43525550d58b
parent71ee82a8aa0c02fc2c73e84f40bdb55512d10938 (diff)
Allow specification of the system V AMD64 ABI constraint.
This can be specified using `extern sysV64 fn` on all platforms
-rw-r--r--src/doc/book/ffi.md1
-rw-r--r--src/librustc_llvm/ffi.rs1
-rw-r--r--src/librustc_trans/abi.rs1
-rw-r--r--src/libsyntax/abi.rs2
4 files changed, 5 insertions, 0 deletions
diff --git a/src/doc/book/ffi.md b/src/doc/book/ffi.md
index ca104ff29ac..44cc75f8fed 100644
--- a/src/doc/book/ffi.md
+++ b/src/doc/book/ffi.md
@@ -539,6 +539,7 @@ This is currently hidden behind the `abi_vectorcall` gate and is subject to chan
 * `system`
 * `C`
 * `win64`
+* `sysV64`
 
 Most of the abis in this list are self-explanatory, but the `system` abi may
 seem a little odd. This constraint selects whatever the appropriate ABI is for
diff --git a/src/librustc_llvm/ffi.rs b/src/librustc_llvm/ffi.rs
index 754910c246d..92fe568a72c 100644
--- a/src/librustc_llvm/ffi.rs
+++ b/src/librustc_llvm/ffi.rs
@@ -42,6 +42,7 @@ pub enum CallConv {
     ColdCallConv = 9,
     X86StdcallCallConv = 64,
     X86FastcallCallConv = 65,
+    X86_64_SysV = 78,
     X86_64_Win64 = 79,
     X86_VectorCall = 80
 }
diff --git a/src/librustc_trans/abi.rs b/src/librustc_trans/abi.rs
index 3a7fde6a36b..9f3c20a4fd0 100644
--- a/src/librustc_trans/abi.rs
+++ b/src/librustc_trans/abi.rs
@@ -269,6 +269,7 @@ impl FnType {
             Vectorcall => llvm::X86_VectorCall,
             C => llvm::CCallConv,
             Win64 => llvm::X86_64_Win64,
+            SysV64 => llvm::X86_64_SysV,
 
             // These API constants ought to be more specific...
             Cdecl => llvm::CCallConv,
diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs
index c959e2108f5..9fb2b539b8f 100644
--- a/src/libsyntax/abi.rs
+++ b/src/libsyntax/abi.rs
@@ -39,6 +39,7 @@ pub enum Abi {
     Vectorcall,
     Aapcs,
     Win64,
+    SysV64,
 
     // Multiplatform ABIs second
     Rust,
@@ -86,6 +87,7 @@ const AbiDatas: &'static [AbiData] = &[
     AbiData {abi: Abi::Vectorcall, name: "vectorcall"},
     AbiData {abi: Abi::Aapcs, name: "aapcs" },
     AbiData {abi: Abi::Win64, name: "win64" },
+    AbiData {abi: Abi::SysV64, name: "sysV64" },
 
     // Cross-platform ABIs
     //