std_detect: Always avoid dlsym on *-linux-{musl,ohos}* targets #1746
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Similar to #1375 (for
*-linux-gnu*
) and #1406 (for*-android*
), but for-linux-{musl,ohos}*
:*-linux-musl*
targets (at least since Rust 1.15) use musl newer than musl 1.1.0 that addedgetauxval
*-linux-ohos*
targets use a fork of musl 1.2On musl with static linking, there is a known problem that
getauxval
is not always available, independent of version requirements: rust-lang/rust#89626However, this seems to be due to the fact that
compiler-builtins
is built beforelibc
(which is a dependency ofstd
) links musl. So IIUC thestd
and its dependent can usegetauxval
without this problem (std_detect
is a part ofstd
). Actuallystd
uses it since Rust 1.78: rust-lang/rust@9da004eAfter this PR, remaining linux/android targets that use dlsym are:
*-android*
: This is actually a issue inlibc
crate std_detect: Do not use libc::getauxval on 32-bit Android #1421*-linux-uclibc*
: uclibc-ng supportsgetauxval
since 1.0.43std
cannot be compiled with these toolchains without a patch because the commit mentioned above that started usinggetauxval
is included. (Either thestd
or the platform support documentation should be fixed.)*-linux-none
: This target does not use any libc APIs.std
in the first place and only for x86_64 which doesn't usegetauxval
.getauxval
.