-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Description
Compiling code like:
results in:
LLVM ERROR: Unsupported calling convention
presumably because rustc
attempts to translate it into an x86-specific ABI, which the AArch64 backend rightly rejects.
clang
already ignores __stdcall
for non-x86 targets:
https://reviews.llvm.org/D36105
I'm not completely sure what the right answer for Rust is. I think Target::adjust_abi
is the rough equivalent of the above clang bit and needs to take a few more cases into account for non-x86 Windows:
rust/src/librustc_target/spec/mod.rs
Lines 764 to 776 in 31789a6
/// Given a function ABI, turn "System" into the correct ABI for this target. | |
pub fn adjust_abi(&self, abi: Abi) -> Abi { | |
match abi { | |
Abi::System => { | |
if self.options.is_like_windows && self.arch == "x86" { | |
Abi::Stdcall | |
} else { | |
Abi::C | |
} | |
}, | |
abi => abi | |
} | |
} |
@alexcrichton does that sound right? If so, I'll code up a patch.
Metadata
Metadata
Assignees
Labels
No labels