From 0b996a03c7ba2d4580bcbe3e500eb28a8904d5d0 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sat, 7 Oct 2023 10:35:22 +0000 Subject: [PATCH] Disable inline asm support on Windows again The external assembler is missing on Windows --- src/global_asm.rs | 2 +- src/inline_asm.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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; }