From c43afcbb30a2bd045c1d833fd0aff8a2039808be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Tue, 29 Mar 2022 01:27:53 +0200 Subject: [PATCH 1/3] Do not link `psm_s` when `asm` feature is disabled --- psm/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psm/src/lib.rs b/psm/src/lib.rs index 61ab9a8..b9050c8 100644 --- a/psm/src/lib.rs +++ b/psm/src/lib.rs @@ -56,7 +56,7 @@ macro_rules! extern_item { // NB: this could be nicer across multiple blocks but we cannot do it because of // https://github.com/rust-lang/rust/issues/65847 extern_item! { { - #![link(name="psm_s")] + #![cfg_attr(asm, link(name="psm_s"))] #[cfg(asm)] fn rust_psm_stack_direction() -> u8; From 0f69bd6c163497d9a8c11c4f4e8ce2ee32c40e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Wed, 30 Mar 2022 21:50:34 +0200 Subject: [PATCH 2/3] Add Windows ifdef to AArch64 assembly --- psm/src/arch/aarch_aapcs64.s | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/psm/src/arch/aarch_aapcs64.s b/psm/src/arch/aarch_aapcs64.s index 55917f3..06a6245 100644 --- a/psm/src/arch/aarch_aapcs64.s +++ b/psm/src/arch/aarch_aapcs64.s @@ -9,6 +9,13 @@ #define FUNCTION(fnname) _##fnname #define SIZE(fnname,endlabel) +#elif CFG_TARGET_OS_windows + +#define GLOBL(fnname) .globl fnname +#define TYPE(fnname) +#define FUNCTION(fnname) fnname +#define SIZE(fnname,endlabel) + #else #define GLOBL(fnname) .globl fnname From 47839e7e86a49f422ab5c27ce464e737bd6bb29c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Wed, 30 Mar 2022 21:54:20 +0200 Subject: [PATCH 3/3] Unify Windows envs in `build.rs` --- psm/build.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/psm/build.rs b/psm/build.rs index c68205b..62e8d7b 100644 --- a/psm/build.rs +++ b/psm/build.rs @@ -12,14 +12,14 @@ fn find_assembly( // is not supported in Windows. For x86_64 the implementation actually works locally, // but failed tests in CI (???). Might want to have a feature for experimental support // here. - ("x86", _, "windows", "msvc") => { + ("x86", _, "windows", _) => { if masm { Some(("src/arch/x86_msvc.asm", false)) } else { Some(("src/arch/x86_windows_gnu.s", false)) } } - ("x86_64", _, "windows", "msvc") => { + ("x86_64", _, "windows", _) => { if masm { Some(("src/arch/x86_64_msvc.asm", false)) } else { @@ -27,15 +27,13 @@ fn find_assembly( } } ("arm", _, "windows", "msvc") => Some(("src/arch/arm_armasm.asm", false)), - ("aarch64", _, "windows", "msvc") => { + ("aarch64", _, "windows", _) => { if masm { Some(("src/arch/aarch64_armasm.asm", false)) } else { Some(("src/arch/aarch_aapcs64.s", false)) } } - ("x86", _, "windows", _) => Some(("src/arch/x86_windows_gnu.s", false)), - ("x86_64", _, "windows", _) => Some(("src/arch/x86_64_windows_gnu.s", false)), ("x86", _, _, _) => Some(("src/arch/x86.s", true)), ("x86_64", _, _, _) => Some(("src/arch/x86_64.s", true)), ("arm", _, _, _) => Some(("src/arch/arm_aapcs.s", true)),