diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
commit | 837b550238aa671a591ccf282dddeab29cadb206 (patch) | |
tree | 914b6b8862bace72bd3245ca184d374b08d8a672 /vendor/rustix/build.rs | |
parent | Adding debian version 1.70.0+dfsg2-1. (diff) | |
download | rustc-837b550238aa671a591ccf282dddeab29cadb206.tar.xz rustc-837b550238aa671a591ccf282dddeab29cadb206.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/build.rs')
-rw-r--r-- | vendor/rustix/build.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vendor/rustix/build.rs b/vendor/rustix/build.rs index d8d1c8bd6..8b5c55a9d 100644 --- a/vendor/rustix/build.rs +++ b/vendor/rustix/build.rs @@ -3,7 +3,7 @@ use cc::Build; use std::env::var; use std::io::Write; -/// The directory for out-of-line ("outline") libraries. +/// The directory for out-of-line (“outline”) libraries. const OUTLINE_PATH: &str = "src/backend/linux_raw/arch/outline"; fn main() { @@ -24,6 +24,7 @@ fn main() { // Gather target information. let arch = var("CARGO_CFG_TARGET_ARCH").unwrap(); + let vendor = var("CARGO_CFG_TARGET_VENDOR").unwrap(); let asm_name = format!("{}/{}.s", OUTLINE_PATH, arch); let asm_name_present = std::fs::metadata(&asm_name).is_ok(); let target_os = var("CARGO_CFG_TARGET_OS").unwrap(); @@ -84,7 +85,7 @@ fn main() { // Use inline asm if we have it, or outline asm otherwise. On PowerPC // and MIPS, Rust's inline asm is considered experimental, so only use // it if `--cfg=rustix_use_experimental_asm` is given. - if (feature_rustc_dep_of_std || can_compile("use std::arch::asm;")) + if (feature_rustc_dep_of_std || vendor == "mustang" || can_compile("use std::arch::asm;")) && (arch != "x86" || has_feature("naked_functions")) && ((arch != "powerpc64" && arch != "mips" && arch != "mips64") || rustix_use_experimental_asm) @@ -138,6 +139,9 @@ fn main() { { use_feature("bsd"); } + if target_os == "wasi" { + use_feature_or_nothing("wasi_ext"); + } println!("cargo:rerun-if-env-changed=CARGO_CFG_RUSTIX_USE_EXPERIMENTAL_ASM"); println!("cargo:rerun-if-env-changed=CARGO_CFG_RUSTIX_USE_LIBC"); |