Skip to content

List all available ABI strings in reference.md #34267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
liigo opened this issue Jun 14, 2016 · 9 comments
Closed

List all available ABI strings in reference.md #34267

liigo opened this issue Jun 14, 2016 · 9 comments

Comments

@liigo
Copy link
Contributor

liigo commented Jun 14, 2016

No description provided.

@steveklabnik steveklabnik added A-docs E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Jun 14, 2016
@nagisa
Copy link
Member

nagisa commented Jun 14, 2016

Thing with these “ABI strings” is that its dubious how many of them we want to consider stable. C is obvious as are microsoft’s ABIs… but everything else… shrugs?

@steveklabnik
Copy link
Member

/cc @rust-lang/lang

@liigo
Copy link
Contributor Author

liigo commented Jun 17, 2016

extern "foo" {}

fn main() {
}

rustc may prints all available abi:

<anon>:1:8: 1:13 error: invalid ABI: expected one of [cdecl, stdcall, fastcall, vectorcall, aapcs, win64, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic], found `foo`
<anon>:1 extern "foo" {}
                ^~~~~
error: aborting due to previous error

@jethrogb
Copy link
Contributor

For reference, the LLVM supported calling conventions are http://llvm.org/docs/doxygen/html/namespacellvm_1_1CallingConv.html and the rust calling conventions are

rust/src/libsyntax/abi.rs

Lines 81 to 100 in c66d238

const AbiDatas: &'static [AbiData] = &[
// Platform-specific ABIs
AbiData {abi: Abi::Cdecl, name: "cdecl" },
AbiData {abi: Abi::Stdcall, name: "stdcall" },
AbiData {abi: Abi::Fastcall, name: "fastcall" },
AbiData {abi: Abi::Vectorcall, name: "vectorcall"},
AbiData {abi: Abi::Aapcs, name: "aapcs" },
AbiData {abi: Abi::Win64, name: "win64" },
// Cross-platform ABIs
//
// NB: Do not adjust this ordering without
// adjusting the indices below.
AbiData {abi: Abi::Rust, name: "Rust" },
AbiData {abi: Abi::C, name: "C" },
AbiData {abi: Abi::System, name: "system" },
AbiData {abi: Abi::RustIntrinsic, name: "rust-intrinsic" },
AbiData {abi: Abi::RustCall, name: "rust-call" },
AbiData {abi: Abi::PlatformIntrinsic, name: "platform-intrinsic" }
];

@strega-nil
Copy link
Contributor

strega-nil commented Jun 21, 2016

I think that "Rust" and "C" calling conventions should be declared standard Rust, i.e., any Rust compiler has to at least have the "Rust" calling convention (of course), and the "C" calling convention (in order to compile as much code as possible, and to interop with C/other languages); however, I think the other calling conventions should be rustc specific. These are the safest ABIs we can reasonably say are probably everywhere.

@jethrogb
Copy link
Contributor

@ubsan Also "system"

@strega-nil
Copy link
Contributor

@jethrogb I don't know if "system" should be required by every compiler. "Rust" and "C" seem far more universal, whereas "system" only does anything on x32 Windows.

Might be enough code uses "system" to justify its inclusion, however.

@steveklabnik steveklabnik added E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. E-help-wanted Call for participation: Help is requested to fix this issue. and removed E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Jun 27, 2016
@brson brson removed the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Jun 28, 2016
@brson
Copy link
Contributor

brson commented Jun 28, 2016

Removed the easy tag since there's no agreement about what to document.

@strega-nil
Copy link
Contributor

Fixed by #34461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants