From 1deb9044d44faa27258c982e440ede7973535ebd Mon Sep 17 00:00:00 2001 From: fys Date: Sat, 24 Aug 2024 19:18:11 +0800 Subject: [PATCH 1/2] enable backtrace-rs/dl_iterate_phdr feature unconditionally. --- library/std/build.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/library/std/build.rs b/library/std/build.rs index 35a5977b6ebaf..3af27e69ed388 100644 --- a/library/std/build.rs +++ b/library/std/build.rs @@ -58,6 +58,18 @@ fn main() { || env::var("RUSTC_BOOTSTRAP_SYNTHETIC_TARGET").is_ok() { // These platforms don't have any special requirements. + } else if target_os == "android" { + // Since rust-lang/rust#120593 , + // the minimum Android API level change from 19 to 21. And Android supports + // `dl_iterate_phdr` since API level 21. Please see + // + // for details. So we can enable `dl_iterate_phdr` feature for Android witout + // checking the Android API level. + // + // Note: after , backtrace-rs + // removed the special build logic for Android. So We can remove the next line, + // once backtrace-rs in std is updated to the version that includes the change. + println!("cargo:rustc-cfg=feature=\"dl_iterate_phdr\""); } else { // This is for Cargo's build-std support, to mark std as unstable for // typically no_std platforms. From 3d2d563d5ee9fcb74850d30cc44ebee00550307e Mon Sep 17 00:00:00 2001 From: fys Date: Sat, 24 Aug 2024 19:26:25 +0800 Subject: [PATCH 2/2] fix typo --- library/std/build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/build.rs b/library/std/build.rs index 3af27e69ed388..1e14b5c12cdf7 100644 --- a/library/std/build.rs +++ b/library/std/build.rs @@ -63,7 +63,7 @@ fn main() { // the minimum Android API level change from 19 to 21. And Android supports // `dl_iterate_phdr` since API level 21. Please see // - // for details. So we can enable `dl_iterate_phdr` feature for Android witout + // for details. So we can enable `dl_iterate_phdr` feature for Android without // checking the Android API level. // // Note: after , backtrace-rs @@ -155,7 +155,7 @@ fn main() { // These are currently empty, but will fill up as some platforms move from completely // unreliable to reliable basics but unreliable math. - // LLVM is currenlty adding missing routines, + // LLVM is currently adding missing routines, let has_reliable_f16_math = has_reliable_f16 && match (target_arch.as_str(), target_os.as_str()) { // FIXME: Disabled on Miri as the intrinsics are not implemented yet.