diff --git a/config.sh b/config.sh index 0f75e331a7e..9a745ad5952 100644 --- a/config.sh +++ b/config.sh @@ -12,6 +12,7 @@ fi HOST_TRIPLE=$(rustc -vV | grep host | cut -d: -f2 | tr -d " ") TARGET_TRIPLE=$HOST_TRIPLE +#TARGET_TRIPLE="x86_64-pc-windows-gnu" #TARGET_TRIPLE="aarch64-unknown-linux-gnu" linker='' @@ -21,6 +22,9 @@ if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then # We are cross-compiling for aarch64. Use the correct linker and run tests in qemu. linker='-Clinker=aarch64-linux-gnu-gcc' RUN_WRAPPER='qemu-aarch64 -L /usr/aarch64-linux-gnu' + elif [[ "$TARGET_TRIPLE" == "x86_64-pc-windows-gnu" ]]; then + # We are cross-compiling for Windows. Run tests in wine. + RUN_WRAPPER='wine' else echo "Unknown non-native platform" fi diff --git a/src/abi/mod.rs b/src/abi/mod.rs index 8f59fa91bfb..8b00304e040 100644 --- a/src/abi/mod.rs +++ b/src/abi/mod.rs @@ -85,18 +85,12 @@ fn clif_sig_from_fn_sig<'tcx>( requires_caller_location: bool, ) -> Signature { let abi = match sig.abi { - Abi::System => { - if tcx.sess.target.target.options.is_like_windows { - unimplemented!() - } else { - Abi::C - } - } + Abi::System => Abi::C, abi => abi, }; let (call_conv, inputs, output): (CallConv, Vec>, Ty<'tcx>) = match abi { Abi::Rust => (CallConv::triple_default(triple), sig.inputs().to_vec(), sig.output()), - Abi::C => (CallConv::triple_default(triple), sig.inputs().to_vec(), sig.output()), + Abi::C | Abi::Unadjusted => (CallConv::triple_default(triple), sig.inputs().to_vec(), sig.output()), Abi::RustCall => { assert_eq!(sig.inputs().len(), 2); let extra_args = match sig.inputs().last().unwrap().kind { diff --git a/src/base.rs b/src/base.rs index 244e06f7627..547ed01503e 100644 --- a/src/base.rs +++ b/src/base.rs @@ -679,6 +679,17 @@ fn trans_stmt<'tcx>( crate::trap::trap_unimplemented(fx, "_xgetbv arch intrinsic is not supported"); } + // ___chkstk, ___chkstk_ms and __alloca are only used on Windows + _ if fx.tcx.symbol_name(fx.instance).name.as_str().starts_with("___chkstk") => { + crate::trap::trap_unimplemented(fx, "Stack probes are not supported"); + } + _ if fx.tcx.symbol_name(fx.instance).name.as_str() == "__alloca" => { + crate::trap::trap_unimplemented(fx, "Alloca is not supported"); + } + // Used in sys::windows::abort_internal + "int $$0x29" => { + crate::trap::trap_unimplemented(fx, "Windows abort"); + } _ => unimpl_fatal!(fx.tcx, stmt.source_info.span, "Inline assembly is not supported"), } }