diff options
author | Jonathan Schwender <55576758+jschwe@users.noreply.github.com> | 2024-08-14 09:30:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-14 01:30:04 +0000 |
commit | 3aef023368d522251d72443e1b5c03c2fc3208d3 (patch) | |
tree | edf747d00eddaef8ea3847cd47c7cd000a0d84bd /components/background_hang_monitor | |
parent | 478d95d2454f15184b45c5887af05c1cf51d2b23 (diff) | |
download | servo-3aef023368d522251d72443e1b5c03c2fc3208d3.tar.gz servo-3aef023368d522251d72443e1b5c03c2fc3208d3.zip |
ohos: Fix x86_64-unknown-linux-ohos (#33029)
* ohos: Fix compilation for x86_64
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* ohos: Use the SDK compiler-wrapper
When compiling for x86_64-unknown-linux-ohos without the compiler
wrapper, for some reason mozjs_sys will be refercing a wrong mangled symbol
resulting in the following error when loading the .so at runtime:
```
_ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE: symbol not found
```
This problem does not occur when compiling for aarch64 or when using the compiler wrapper.
In this case the correct symbol
`_ZNSt4__n111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE`
is referenced.
It's unclear why manually passing the flags via CFLAGS / CXXFLAGS does not work.
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
---------
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Diffstat (limited to 'components/background_hang_monitor')
-rw-r--r-- | components/background_hang_monitor/Cargo.toml | 2 | ||||
-rw-r--r-- | components/background_hang_monitor/background_hang_monitor.rs | 7 | ||||
-rw-r--r-- | components/background_hang_monitor/lib.rs | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/components/background_hang_monitor/Cargo.toml b/components/background_hang_monitor/Cargo.toml index 8eb0dbfd7b1..604131013ba 100644 --- a/components/background_hang_monitor/Cargo.toml +++ b/components/background_hang_monitor/Cargo.toml @@ -28,6 +28,6 @@ lazy_static = { workspace = true } [target.'cfg(target_os = "macos")'.dependencies] mach2 = "0.4" -[target.'cfg(all(target_os = "linux", not(any(target_arch = "arm", target_arch = "aarch64"))))'.dependencies] +[target.'cfg(all(target_os = "linux", not(any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos"))))'.dependencies] nix = { version = "0.29", features = ["signal"] } unwind-sys = "0.1.4" diff --git a/components/background_hang_monitor/background_hang_monitor.rs b/components/background_hang_monitor/background_hang_monitor.rs index c0f0d22af14..c35e4f85431 100644 --- a/components/background_hang_monitor/background_hang_monitor.rs +++ b/components/background_hang_monitor/background_hang_monitor.rs @@ -98,12 +98,15 @@ impl BackgroundHangMonitorRegister for HangMonitorRegister { let sampler = crate::sampler_mac::MacOsSampler::new_boxed(); #[cfg(all( target_os = "linux", - not(any(target_arch = "arm", target_arch = "aarch64")) + not(any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos")), ))] let sampler = crate::sampler_linux::LinuxSampler::new_boxed(); #[cfg(any( target_os = "android", - all(target_os = "linux", any(target_arch = "arm", target_arch = "aarch64")) + all( + target_os = "linux", + any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos") + ) ))] let sampler = crate::sampler::DummySampler::new_boxed(); diff --git a/components/background_hang_monitor/lib.rs b/components/background_hang_monitor/lib.rs index dab79b477ff..1db9391a675 100644 --- a/components/background_hang_monitor/lib.rs +++ b/components/background_hang_monitor/lib.rs @@ -8,7 +8,7 @@ pub mod background_hang_monitor; mod sampler; #[cfg(all( target_os = "linux", - not(any(target_arch = "arm", target_arch = "aarch64")) + not(any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos")) ))] mod sampler_linux; #[cfg(target_os = "macos")] |