Add aarch64-*-windows-gnu* support#65
Conversation
psm/build.rs
Outdated
| Some(("src/arch/aarch_aapcs64.s", false)) | ||
| } | ||
| } | ||
| ("aarch64", _, "windows", _) => None, |
There was a problem hiding this comment.
This fails to include support for informational methods (stack direction, pointer.) https://github.com/rust-lang/stacker/blob/master/psm/src/arch/aarch_aapcs64.s should be contain a suitable implementation of these functions.
Why not generalize the match above to match gnu too?
("aarch64", _, "windows", _) => {
if masm {
Some(("src/arch/aarch64_armasm.asm", false))
} else {
Some(("src/arch/aarch_aapcs64.s", false))
}
}There was a problem hiding this comment.
OOTB it using this assembly with Clang fails with:
running: "aarch64-w64-mingw32-clang" "-O3" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-gnullvm" "-ffunction-sections" "-fdata-sections" "--target=aarch64-pc-windows-gnullvm" "-xassembler-with-cpp" "-DCFG_TARGET_OS_windows" "-DCFG_TARGET_ARCH_aarch64" "-DCFG_TARGET_ENV_gnu" "-o" "/home/mateusz/Projects/rust/build/x86_64-unknown-linux-gnu/stage0-rustc/aarch64-pc-windows-gnullvm/release/build/psm-e1f284177df4f4bb/out/src/arch/aarch_aapcs64.o" "-c" "src/arch/aarch_aapcs64.s"
cargo:warning=src/arch/aarch_aapcs64.s:24:7: error: expected absolute expression
cargo:warning=.type rust_psm_stack_direction,@function
cargo:warning= ^
cargo:warning=src/arch/aarch_aapcs64.s:31:1: error: unknown directive
cargo:warning=.size rust_psm_stack_direction,.rust_psm_stack_direction_end-rust_psm_stack_direction
cargo:warning=^
cargo:warning=src/arch/aarch_aapcs64.s:37:7: error: expected absolute expression
cargo:warning=.type rust_psm_stack_pointer,@function
cargo:warning= ^
cargo:warning=src/arch/aarch_aapcs64.s:44:1: error: unknown directive
cargo:warning=.size rust_psm_stack_pointer,.rust_psm_stack_pointer_end-rust_psm_stack_pointer
cargo:warning=^
cargo:warning=src/arch/aarch_aapcs64.s:50:7: error: expected absolute expression
cargo:warning=.type rust_psm_replace_stack,@function
cargo:warning= ^
cargo:warning=src/arch/aarch_aapcs64.s:58:1: error: unknown directive
cargo:warning=.size rust_psm_replace_stack,.rust_psm_replace_stack_end-rust_psm_replace_stack
cargo:warning=^
cargo:warning=src/arch/aarch_aapcs64.s:64:7: error: expected absolute expression
cargo:warning=.type rust_psm_on_stack,@function
cargo:warning= ^
cargo:warning=src/arch/aarch_aapcs64.s:84:1: error: unknown directive
cargo:warning=.size rust_psm_on_stack,.rust_psm_on_stack_end-rust_psm_on_stack
cargo:warning=^
Makes me wonder what assembler was used with msvc toolchain when masm is unavailable.
Managed to cross compile Rust with this change to aarch_aapcs64.s:
#define GLOBL(fnname) .globl fnname
#define TYPE(fnname)
#define FUNCTION(fnname) fnname
#define SIZE(fnname,endlabel)I don't have AArch64 Windows to test it though, should I ask somebody to test Rust with this change for me and update PR if it works?
There was a problem hiding this comment.
Hm, I wonder if this a limitation of the LLVM's built-in assembler.
I don't have AArch64 Windows to test it though, should I ask somebody to test Rust with this change for me and update PR if it works?
I don't anticipate such a change to affect the behaviour of this library during a “normal” operation, but I could see it having an effect on generation of unwind tables… Since we aren't looking to support actual segmented stacks in psm on windows without Fibers, I think it is fine to make the proposed change (especially because the .type and .size directives are applicable for COFF output anyway)
There was a problem hiding this comment.
Makes me wonder what assembler was used with msvc toolchain when masm is unavailable.
This configuration is largely untested ^^. The only non-msvc target actually tested is x86*windows-gnu.
daea6d0 to
47839e7
Compare
aarch64-*-windows-gnu* support (without assembly)aarch64-*-windows-gnu* support
|
Thanks! |
|
it still fails with Details |
|
Maybe a regression from f7f1e58? |
Rust PR for the target: rust-lang/rust#94872
First commit disables linking
psm_swhen it's absent since assembly is not compiled.