summaryrefslogtreecommitdiffstats
path: root/library/stdarch/crates/std_detect/README.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /library/stdarch/crates/std_detect/README.md
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/stdarch/crates/std_detect/README.md')
-rw-r--r--library/stdarch/crates/std_detect/README.md18
1 files changed, 14 insertions, 4 deletions
diff --git a/library/stdarch/crates/std_detect/README.md b/library/stdarch/crates/std_detect/README.md
index bea7d941a..71f474d65 100644
--- a/library/stdarch/crates/std_detect/README.md
+++ b/library/stdarch/crates/std_detect/README.md
@@ -30,6 +30,8 @@ run-time feature detection. When this feature is disabled, `std_detect` assumes
that [`getauxval`] is linked to the binary. If that is not the case the behavior
is undefined.
+ Note: This feature is ignored on `*-linux-gnu*` targets, since all `*-linux-gnu*` targets ([since Rust 1.64](https://blog.rust-lang.org/2022/08/01/Increasing-glibc-kernel-requirements.html)) have glibc requirements higher than [glibc 2.16 that added `getauxval`](https://sourceware.org/legacy-ml/libc-announce/2012/msg00000.html), and we can safely assume [`getauxval`] is linked to the binary.
+
* `std_detect_file_io` (enabled by default, requires `std`): Enable to perform run-time feature
detection using file APIs (e.g. `/proc/cpuinfo`, etc.) if other more performant
methods fail. This feature requires `libstd` as a dependency, preventing the
@@ -44,17 +46,25 @@ crate from working on applications in which `std` is not available.
the operating system. `std_detect` assumes that the binary is an user-space
application. If you need raw support for querying `cpuid`, consider using the
[`cupid`](https://crates.io/crates/cupid) crate.
-
-* Linux:
- * `arm{32, 64}`, `mips{32,64}{,el}`, `powerpc{32,64}{,le}`: `std_detect`
+
+* Linux/Android:
+ * `arm{32, 64}`, `mips{32,64}{,el}`, `powerpc{32,64}{,le}`, `riscv{32,64}`: `std_detect`
supports these on Linux by querying ELF auxiliary vectors (using `getauxval`
- when available), and if that fails, by querying `/proc/cpuinfo`.
+ when available), and if that fails, by querying `/proc/cpuinfo`.
* `arm64`: partial support for doing run-time feature detection by directly
querying `mrs` is implemented for Linux >= 4.11, but not enabled by default.
* FreeBSD:
+ * `arm32`, `powerpc64`: `std_detect` supports these on FreeBSD by querying ELF
+ auxiliary vectors using `sysctl`.
* `arm64`: run-time feature detection is implemented by directly querying `mrs`.
+* OpenBSD:
+ * `arm64`: run-time feature detection is implemented by querying `sysctl`.
+
+* Windows:
+ * `arm64`: run-time feature detection is implemented by querying `IsProcessorFeaturePresent`.
+
# License
This project is licensed under either of