Skip to content

Commit 4ea5190

Browse files
committed
Auto merge of rust-lang#116318 - pitaj:android-backtrace-build, r=workingjubilee
Invoke `backtrace-rs` buildscript in `std` buildscript Based on rust-lang#99883 by `@Arc-blroth` Depends on rust-lang/backtrace-rs#556 and rust-lang/cc-rs#705
2 parents 93b6a36 + 9367727 commit 4ea5190

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -5013,6 +5013,7 @@ version = "0.0.0"
50135013
dependencies = [
50145014
"addr2line",
50155015
"alloc",
5016+
"cc",
50165017
"cfg-if",
50175018
"compiler_builtins",
50185019
"core",

library/std/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ object = { version = "0.32.0", default-features = false, optional = true, featur
3636
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
3737
rand_xorshift = "0.3.0"
3838

39+
[build-dependencies]
40+
# Dependency of the `backtrace` crate's build script
41+
cc = "1.0.67"
42+
3943
[target.'cfg(any(all(target_family = "wasm", target_os = "unknown"), target_os = "xous", all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies]
4044
dlmalloc = { version = "0.2.4", features = ['rustc-dep-of-std'] }
4145

library/std/build.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
use std::env;
22

3+
// backtrace-rs requires a feature check on Android targets, so
4+
// we need to run its build.rs as well.
5+
#[allow(unused_extern_crates)]
6+
#[path = "../backtrace/build.rs"]
7+
mod backtrace_build_rs;
8+
39
fn main() {
410
println!("cargo:rerun-if-changed=build.rs");
511
let target = env::var("TARGET").expect("TARGET was not set");
@@ -58,4 +64,6 @@ fn main() {
5864
}
5965
println!("cargo:rustc-env=STD_ENV_ARCH={}", env::var("CARGO_CFG_TARGET_ARCH").unwrap());
6066
println!("cargo:rustc-cfg=backtrace_in_libstd");
67+
68+
backtrace_build_rs::main();
6169
}

0 commit comments

Comments
 (0)