Skip to content

Commit

Permalink
Disable inline asm support on Windows again
Browse files Browse the repository at this point in the history
The external assembler is missing on Windows
  • Loading branch information
bjorn3 committed Oct 7, 2023
1 parent b49a0ae commit 0b996a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/global_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions src/inline_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0b996a0

Please sign in to comment.