From 0e30446259be88af7b9ae6c733b49fc0c88bd7ce Mon Sep 17 00:00:00 2001 From: CensoredUsername Date: Tue, 30 Aug 2016 03:54:29 +0200 Subject: [PATCH] Select the proper x86_64 ABI based first and foremost on the specified calling convention instead of just looking at the selected platform --- src/librustc_trans/abi.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustc_trans/abi.rs b/src/librustc_trans/abi.rs index 9f3c20a4fd09..7f209dde27db 100644 --- a/src/librustc_trans/abi.rs +++ b/src/librustc_trans/abi.rs @@ -484,7 +484,9 @@ impl FnType { match &ccx.sess().target.target.arch[..] { "x86" => cabi_x86::compute_abi_info(ccx, self), - "x86_64" => if ccx.sess().target.target.options.is_like_windows { + "x86_64" => if abi == Abi::SysV64 { + cabi_x86_64::compute_abi_info(ccx, self); + } else if abi == Abi::Win64 || ccx.sess().target.target.options.is_like_windows { cabi_x86_win64::compute_abi_info(ccx, self); } else { cabi_x86_64::compute_abi_info(ccx, self);