Skip to content

Invoke backtrace-rs' buildscript in std's buildscript for Android targets#99883

Closed
Arc-blroth wants to merge 2 commits intorust-lang:masterfrom
Arc-blroth:fix/backtrace-build
Closed

Invoke backtrace-rs' buildscript in std's buildscript for Android targets#99883
Arc-blroth wants to merge 2 commits intorust-lang:masterfrom
Arc-blroth:fix/backtrace-build

Conversation

@Arc-blroth
Copy link

On Android targets, backtrace-rs uses the buildscript to detect if the Android API level, which is needed to enable backtrace symbolication on targets with Android API >= 21. This PR ensures that backtrace-rs's buildscript is invoked as part of the standard library directly including backtrace.

Alongside the patch from rust-lang/cc-rs#705, this should fix backtraces not being symbolicated on Android, though I have only tested this when building from Windows.

Note that this PR will be essentially a no-op as of right now, since the Rust CI builds with a minimum Android API level of 14 (see rust-lang/release-team#9). A custom toolchain build with a higher minimum API level is required to actually get backtraces with symbols as of right now.

A config.toml for building with the latest Android NDK
profile = "library"
changelog-seen = 2

[build]
target = ["x86_64-pc-windows-msvc", "armv7-linux-androideabi"]

[target.armv7-linux-androideabi]
android-ndk = "C:/Users/arcdev/AppData/Local/Android/Sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/windows-x86_64"
cc = "C:/Users/arcdev/AppData/Local/Android/Sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi21-clang.cmd"
cxx = "C:/Users/arcdev/AppData/Local/Android/Sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi21-clang++.cmd"
linker = "C:/Users/arcdev/AppData/Local/Android/Sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi21-clang++.cmd"
llvm-libunwind = "system"
ar = "C:/msys64/mingw64/bin/ar.exe"

According to the latest Android Platform API Version Distribution, only about 0.4% of Android devices are on Android API version 19 or below, though the latest NDK still supports a lowest API version of 19 (but only for armv7a-linux-androideabi and i686-linux-android and not the other architectures ???).

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.