diff options
| author | bors <bors@rust-lang.org> | 2023-10-07 02:20:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-10-07 02:20:50 +0000 |
| commit | 4ea5190026dbc1302b644d938e68bc6843cb8b24 (patch) | |
| tree | 38a5f844048e9157c7c54542e0cef5611b8dcf44 | |
| parent | 93b6a36568027e44a7345ae8d577c0d13545c79f (diff) | |
| parent | 93677276bc495e78f74536385a16201d465fd523 (diff) | |
Auto merge of #116318 - pitaj:android-backtrace-build, r=workingjubilee
Invoke `backtrace-rs` buildscript in `std` buildscript Based on #99883 by `@Arc-blroth` Depends on rust-lang/backtrace-rs#556 and rust-lang/cc-rs#705
| -rw-r--r-- | Cargo.lock | 1 | ||||
| -rw-r--r-- | library/std/Cargo.toml | 4 | ||||
| -rw-r--r-- | library/std/build.rs | 8 |
3 files changed, 13 insertions, 0 deletions
diff --git a/Cargo.lock b/Cargo.lock index 5c610692765..db316e998c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5013,6 +5013,7 @@ version = "0.0.0" dependencies = [ "addr2line", "alloc", + "cc", "cfg-if", "compiler_builtins", "core", diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml index 965132bdedb..feb6274d029 100644 --- a/library/std/Cargo.toml +++ b/library/std/Cargo.toml @@ -36,6 +36,10 @@ object = { version = "0.32.0", default-features = false, optional = true, featur rand = { version = "0.8.5", default-features = false, features = ["alloc"] } rand_xorshift = "0.3.0" +[build-dependencies] +# Dependency of the `backtrace` crate's build script +cc = "1.0.67" + [target.'cfg(any(all(target_family = "wasm", target_os = "unknown"), target_os = "xous", all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies] dlmalloc = { version = "0.2.4", features = ['rustc-dep-of-std'] } diff --git a/library/std/build.rs b/library/std/build.rs index 36516978b7a..164bca7c436 100644 --- a/library/std/build.rs +++ b/library/std/build.rs @@ -1,5 +1,11 @@ use std::env; +// backtrace-rs requires a feature check on Android targets, so +// we need to run its build.rs as well. +#[allow(unused_extern_crates)] +#[path = "../backtrace/build.rs"] +mod backtrace_build_rs; + fn main() { println!("cargo:rerun-if-changed=build.rs"); let target = env::var("TARGET").expect("TARGET was not set"); @@ -58,4 +64,6 @@ fn main() { } println!("cargo:rustc-env=STD_ENV_ARCH={}", env::var("CARGO_CFG_TARGET_ARCH").unwrap()); println!("cargo:rustc-cfg=backtrace_in_libstd"); + + backtrace_build_rs::main(); } |
