diff --git a/library/std/build.rs b/library/std/build.rs index 35a5977b6ebaf..1e14b5c12cdf7 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 without + // 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. @@ -143,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.