File tree 2 files changed +15
-3
lines changed
compiler/rustc_target/src/spec
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -2813,11 +2813,15 @@ impl Target {
2813
2813
Abi :: EfiApi if self . arch == "x86_64" => Abi :: Win64 { unwind : false } ,
2814
2814
Abi :: EfiApi => Abi :: C { unwind : false } ,
2815
2815
2816
- // See commentary in `is_abi_supported`.
2816
+ // See commentary in `is_abi_supported`: we map these to "C" on targets
2817
+ // where they do not make sense.
2817
2818
Abi :: Stdcall { .. } | Abi :: Thiscall { .. } if self . arch == "x86" => abi,
2818
2819
Abi :: Stdcall { unwind } | Abi :: Thiscall { unwind } => Abi :: C { unwind } ,
2819
- Abi :: Fastcall { .. } if self . arch == "x86" => abi,
2820
- Abi :: Vectorcall { .. } if [ "x86" , "x86_64" ] . contains ( & & self . arch [ ..] ) => abi,
2820
+ Abi :: Fastcall { .. } | Abi :: Vectorcall { .. }
2821
+ if [ "x86" , "x86_64" ] . contains ( & & self . arch [ ..] ) =>
2822
+ {
2823
+ abi
2824
+ }
2821
2825
Abi :: Fastcall { unwind } | Abi :: Vectorcall { unwind } => Abi :: C { unwind } ,
2822
2826
2823
2827
// The Windows x64 calling convention we use for `extern "Rust"`
Original file line number Diff line number Diff line change
1
+ //@ compile-flags: -Z merge-functions=disabled
2
+
1
3
//@ revisions: linux
2
4
//@[linux] compile-flags: --target x86_64-unknown-linux-gnu
3
5
//@[linux] needs-llvm-components: x86
@@ -31,6 +33,12 @@ extern "sysv64" fn pass_zst_sysv64(_: ()) {}
31
33
#[ no_mangle]
32
34
extern "vectorcall" fn pass_zst_vectorcall ( _: ( ) ) { }
33
35
36
+ // windows-gnu: define x86_fastcallcc void @pass_zst_fastcall()
37
+ // windows-msvc: define x86_fastcallcc void @pass_zst_fastcall()
38
+ #[ no_mangle]
39
+ #[ cfg( windows) ] // "fastcall" is not valid on 64bit Linux
40
+ extern "fastcall" fn pass_zst_fastcall ( _: ( ) ) { }
41
+
34
42
// For `extern "C"` functions, ZST are *not* ignored on windows-gnu.
35
43
// That's likely an accident on their side but the ABI is what it is.
36
44
You can’t perform that action at this time.
0 commit comments