Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing backtrace when using std::backtrace::Backtrace on Android #129305

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion library/std/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/rust-lang/rust/pull/120593>,
// the minimum Android API level change from 19 to 21. And Android supports
// `dl_iterate_phdr` since API level 21. Please see
// <https://android.googlesource.com/platform/bionic/+/HEAD/docs/status.md>
// for details. So we can enable `dl_iterate_phdr` feature for Android without
// checking the Android API level.
//
// Note: after <https://github.com/rust-lang/backtrace-rs/pull/656>, 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.
Expand Down Expand Up @@ -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, <https://github.com/llvm/llvm-project/issues/93566>
// LLVM is currently adding missing routines, <https://github.com/llvm/llvm-project/issues/93566>
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.
Expand Down
Loading