diff --git a/psm/build.rs b/psm/build.rs index 7ffb45d..77b9af9 100644 --- a/psm/build.rs +++ b/psm/build.rs @@ -7,7 +7,7 @@ fn find_assembly( env: &str, masm: bool, ) -> Option<(&'static str, bool)> { - println!("cargo::rustc-check-cfg=cfg(switchable_stack,asm)"); + println!("cargo::rustc-check-cfg=cfg(switchable_stack,asm,link_asm)"); match (arch, endian, os, env) { // The implementations for stack switching exist, but, officially, doing so without Fibers // is not supported in Windows. For x86_64 the implementation actually works locally, @@ -79,6 +79,7 @@ fn main() { let asm = if let Some((asm, canswitch)) = find_assembly(&arch, &endian, &os, &env, masm) { println!("cargo:rustc-cfg=asm"); + println!("cargo:rustc-cfg=link_asm"); if canswitch { println!("cargo:rustc-cfg=switchable_stack") } diff --git a/psm/src/lib.rs b/psm/src/lib.rs index b9050c8..de74146 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! { { - #![cfg_attr(asm, link(name="psm_s"))] + #![cfg_attr(link_asm, link(name="psm_s"))] #[cfg(asm)] fn rust_psm_stack_direction() -> u8;