-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-target-specsArea: Compile-target specificationsArea: Compile-target specificationsC-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Currently the following code compiles fine when targetting x86_64.
pub extern "aapcs" fn foo() {}
This code is non-sensical because AAPCS calling convention is only defined for ARM. An example of non-sensical ABI being disallowed is
pub extern "fastcall" fn foo() {}
when compiling with --target=armv7-unknown-linux-gnueabihf
which fails with:
error[E0570]: The ABI `"fastcall"` is not supported for the current target
--> <source>:6:1
|
6 | / extern "fastcall" fn foo() {
7 | | }
| |_^
Targets should be reviewed for such nonsensical ABIs and their blacklists updated. I feel that to avoid this issue in the future we should rather prefer a whitelist of ABIs, rather than a blacklist, and by default put no ABIs, so that the compilation fails until the ABI list is properly populated for the target.
BatmanAoD and gnzlbg
Metadata
Metadata
Assignees
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-target-specsArea: Compile-target specificationsArea: Compile-target specificationsC-bugCategory: This is a bug.Category: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.