summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustix/src/lib.rs')
-rw-r--r--vendor/rustix/src/lib.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/vendor/rustix/src/lib.rs b/vendor/rustix/src/lib.rs
index 9e62b1594..f0e093585 100644
--- a/vendor/rustix/src/lib.rs
+++ b/vendor/rustix/src/lib.rs
@@ -97,7 +97,7 @@
#![cfg_attr(linux_raw, deny(unsafe_code))]
#![cfg_attr(rustc_attrs, feature(rustc_attrs))]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
-#![cfg_attr(all(target_os = "wasi", feature = "std"), feature(wasi_ext))]
+#![cfg_attr(all(wasi_ext, target_os = "wasi", feature = "std"), feature(wasi_ext))]
#![cfg_attr(
all(linux_raw, naked_functions, target_arch = "x86"),
feature(naked_functions)
@@ -122,6 +122,9 @@
#![allow(clippy::unnecessary_cast)]
// It is common in linux and libc APIs for types to vary between platforms.
#![allow(clippy::useless_conversion)]
+// Redox and WASI have enough differences that it isn't worth
+// precisely conditionallizing all the `use`s for them.
+#![cfg_attr(any(target_os = "redox", target_os = "wasi"), allow(unused_imports))]
#[cfg(not(feature = "rustc-dep-of-std"))]
extern crate alloc;
@@ -134,6 +137,18 @@ pub(crate) mod cstr;
pub(crate) mod const_assert;
pub(crate) mod utils;
+// linux_raw: Weak symbols are used by the use-libc-auxv feature for
+// glibc 2.15 support.
+//
+// libc: Weak symbols are used to call various functions available in some
+// versions of libc and not others.
+#[cfg(any(
+ all(linux_raw, feature = "use-libc-auxv"),
+ all(libc, not(any(windows, target_os = "wasi")))
+))]
+#[macro_use]
+mod weak;
+
// Pick the backend implementation to use.
#[cfg_attr(libc, path = "backend/libc/mod.rs")]
#[cfg_attr(linux_raw, path = "backend/linux_raw/mod.rs")]