Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psm: allow manual opt out of #cfg[link("psm_s")] #95

Merged
merged 1 commit into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion psm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion psm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading