mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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>
This commit is contained in:
parent
478d95d245
commit
3aef023368
5 changed files with 10 additions and 7 deletions
2
.github/workflows/ohos.yml
vendored
2
.github/workflows/ohos.yml
vendored
|
@ -29,7 +29,7 @@ jobs:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
arch: ['aarch64-unknown-linux-ohos']
|
arch: ['aarch64-unknown-linux-ohos', 'x86_64-unknown-linux-ohos']
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
if: github.event_name != 'pull_request_target'
|
if: github.event_name != 'pull_request_target'
|
||||||
|
|
|
@ -28,6 +28,6 @@ lazy_static = { 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"))))'.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"] }
|
nix = { version = "0.29", features = ["signal"] }
|
||||||
unwind-sys = "0.1.4"
|
unwind-sys = "0.1.4"
|
||||||
|
|
|
@ -98,12 +98,15 @@ 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"))
|
not(any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos")),
|
||||||
))]
|
))]
|
||||||
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(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();
|
let sampler = crate::sampler::DummySampler::new_boxed();
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ 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"))
|
not(any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos"))
|
||||||
))]
|
))]
|
||||||
mod sampler_linux;
|
mod sampler_linux;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
|
|
|
@ -748,8 +748,8 @@ class CommandBase(object):
|
||||||
env['TARGET_STRIP'] = to_sdk_llvm_bin("llvm-strip")
|
env['TARGET_STRIP'] = to_sdk_llvm_bin("llvm-strip")
|
||||||
|
|
||||||
rust_target_triple = str(self.cross_compile_target).replace('-', '_')
|
rust_target_triple = str(self.cross_compile_target).replace('-', '_')
|
||||||
ndk_clang = to_sdk_llvm_bin("clang")
|
ndk_clang = to_sdk_llvm_bin(f"{self.cross_compile_target}-clang")
|
||||||
ndk_clangxx = to_sdk_llvm_bin("clang++")
|
ndk_clangxx = to_sdk_llvm_bin(f"{self.cross_compile_target}-clang++")
|
||||||
env[f'CC_{rust_target_triple}'] = ndk_clang
|
env[f'CC_{rust_target_triple}'] = ndk_clang
|
||||||
env[f'CXX_{rust_target_triple}'] = ndk_clangxx
|
env[f'CXX_{rust_target_triple}'] = ndk_clangxx
|
||||||
# The clang target name is different from the LLVM target name
|
# The clang target name is different from the LLVM target name
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue