Skip to content

Cross compilation with cargo-xwin from linux to aarch64 windows fails #164

Closed

Description

@konstin

When cross compiling from Linux to Windows using cargo xwin, I get an error about the assembly format.

MRE:

Cargo.toml

[package]
name = "psm-clang-cl-repro"
version = "0.0.0"
edition = "2021"

[dependencies]
psm = "=0.1.32"

and an empty src/lib.rs

rustup target add aarch64-pc-windows-msvc
cargo install cargo-xwin --version 0.23.1 --locked
$ cargo xwin build --target aarch64-pc-windows-msvc
warning: psm@0.1.32: src/arch/aarch_aapcs64.s:30:1: error: unrecognized instruction mnemonic
warning: psm@0.1.32: GLOBL(rust_psm_stack_direction)
warning: psm@0.1.32: ^

It says warning but that fails the compilation.

The problem seems to be that we need to turn GLOBL(rust_psm_stack_direction) into .globl rust_psm_stack_direction. In the current configuration, clang-cl counts as msvc-like and the preprocessing step that does that gets skipped, which then fails PSM.

It looks like #163 fixes this, at least in my limited testing.

Activity

  1. konstin commented on Nov 22, 2026

    @konstin
    ContributorAuthor

    Thanks for reviewing this! Would it be possible to tag a new release, so we can propagate the fix to crates using stacker/psm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions