mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
background_hang_monitor: Add musl compatibility (#33153)
musl does not have libunwind readily available; even if it did, it has no concept of ucontext (needing an external lib). Similar to ohos, disable the background hang monitor and use the DummySampler. Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
This commit is contained in:
parent
7501e3e12f
commit
0e56241c1b
3 changed files with 19 additions and 4 deletions
|
@ -25,6 +25,6 @@ serde_json = { workspace = true }
|
||||||
[target.'cfg(target_os = "macos")'.dependencies]
|
[target.'cfg(target_os = "macos")'.dependencies]
|
||||||
mach2 = "0.4"
|
mach2 = "0.4"
|
||||||
|
|
||||||
[target.'cfg(all(target_os = "linux", not(any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos"))))'.dependencies]
|
[target.'cfg(all(target_os = "linux", not(any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos", target_env = "musl"))))'.dependencies]
|
||||||
nix = { workspace = true, features = ["signal"] }
|
nix = { workspace = true, features = ["signal"] }
|
||||||
unwind-sys = "0.1.4"
|
unwind-sys = "0.1.4"
|
||||||
|
|
|
@ -98,14 +98,24 @@ impl BackgroundHangMonitorRegister for HangMonitorRegister {
|
||||||
let sampler = crate::sampler_mac::MacOsSampler::new_boxed();
|
let sampler = crate::sampler_mac::MacOsSampler::new_boxed();
|
||||||
#[cfg(all(
|
#[cfg(all(
|
||||||
target_os = "linux",
|
target_os = "linux",
|
||||||
not(any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos")),
|
not(any(
|
||||||
|
target_arch = "arm",
|
||||||
|
target_arch = "aarch64",
|
||||||
|
target_env = "ohos",
|
||||||
|
target_env = "musl"
|
||||||
|
)),
|
||||||
))]
|
))]
|
||||||
let sampler = crate::sampler_linux::LinuxSampler::new_boxed();
|
let sampler = crate::sampler_linux::LinuxSampler::new_boxed();
|
||||||
#[cfg(any(
|
#[cfg(any(
|
||||||
target_os = "android",
|
target_os = "android",
|
||||||
all(
|
all(
|
||||||
target_os = "linux",
|
target_os = "linux",
|
||||||
any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos")
|
any(
|
||||||
|
target_arch = "arm",
|
||||||
|
target_arch = "aarch64",
|
||||||
|
target_env = "ohos",
|
||||||
|
target_env = "musl"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
))]
|
))]
|
||||||
let sampler = crate::sampler::DummySampler::new_boxed();
|
let sampler = crate::sampler::DummySampler::new_boxed();
|
||||||
|
|
|
@ -8,7 +8,12 @@ pub mod background_hang_monitor;
|
||||||
mod sampler;
|
mod sampler;
|
||||||
#[cfg(all(
|
#[cfg(all(
|
||||||
target_os = "linux",
|
target_os = "linux",
|
||||||
not(any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos"))
|
not(any(
|
||||||
|
target_arch = "arm",
|
||||||
|
target_arch = "aarch64",
|
||||||
|
target_env = "ohos",
|
||||||
|
target_env = "musl"
|
||||||
|
))
|
||||||
))]
|
))]
|
||||||
mod sampler_linux;
|
mod sampler_linux;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue