Skip to content

Commit 1deb904

Browse files
committed
enable backtrace-rs/dl_iterate_phdr feature unconditionally.
1 parent fdf61d4 commit 1deb904

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

library/std/build.rs

+12
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ fn main() {
5858
|| env::var("RUSTC_BOOTSTRAP_SYNTHETIC_TARGET").is_ok()
5959
{
6060
// These platforms don't have any special requirements.
61+
} else if target_os == "android" {
62+
// Since rust-lang/rust#120593 <https://github.com/rust-lang/rust/pull/120593>,
63+
// the minimum Android API level change from 19 to 21. And Android supports
64+
// `dl_iterate_phdr` since API level 21. Please see
65+
// <https://android.googlesource.com/platform/bionic/+/HEAD/docs/status.md>
66+
// for details. So we can enable `dl_iterate_phdr` feature for Android witout
67+
// checking the Android API level.
68+
//
69+
// Note: after <https://github.com/rust-lang/backtrace-rs/pull/656>, backtrace-rs
70+
// removed the special build logic for Android. So We can remove the next line,
71+
// once backtrace-rs in std is updated to the version that includes the change.
72+
println!("cargo:rustc-cfg=feature=\"dl_iterate_phdr\"");
6173
} else {
6274
// This is for Cargo's build-std support, to mark std as unstable for
6375
// typically no_std platforms.

0 commit comments

Comments
 (0)