diff --git a/src/global_asm.rs b/src/global_asm.rs index 868064774..ebd9b728d 100644 --- a/src/global_asm.rs +++ b/src/global_asm.rs @@ -90,7 +90,7 @@ pub(crate) struct GlobalAsmConfig { impl GlobalAsmConfig { pub(crate) fn new(tcx: TyCtxt<'_>) -> Self { - let asm_enabled = cfg!(feature = "inline_asm"); + let asm_enabled = cfg!(feature = "inline_asm") && !tcx.sess.target.is_like_windows; GlobalAsmConfig { asm_enabled, diff --git a/src/inline_asm.rs b/src/inline_asm.rs index 02c46465b..d029c7066 100644 --- a/src/inline_asm.rs +++ b/src/inline_asm.rs @@ -44,9 +44,11 @@ pub(crate) fn codegen_inline_asm<'tcx>( ) { // FIXME add .eh_frame unwind info directives - if !template.is_empty() && cfg!(not(feature = "inline_asm")) { + if !template.is_empty() + && (cfg!(not(feature = "inline_asm")) || fx.tcx.sess.target.is_like_windows) + { // Used by panic_abort - if template[0] == InlineAsmTemplatePiece::String("int $$0x29".to_string()) { + if template[0] == InlineAsmTemplatePiece::String("int 0x29".to_string()) { fx.bcx.ins().trap(TrapCode::User(1)); return; }