1
Fork 0

add fix for full tools and sanitizer

This commit is contained in:
LuuuXXX 2025-02-24 11:42:07 +08:00
parent 7279acf202
commit 6efacfb7a5
8 changed files with 43 additions and 16 deletions

View file

@ -1997,22 +1997,22 @@ dependencies = [
] ]
[[package]] [[package]]
name = "libffi" name = "libffi-sys2"
version = "3.2.0" version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce826c243048e3d5cec441799724de52e2d42f820468431fc3fceee2341871e2" checksum = "47aedd9774ffb3dcab5c96f593cb5a0caf421a5e38b16bab3b8cdef5facb6ea2"
dependencies = [ dependencies = [
"libc", "cc",
"libffi-sys",
] ]
[[package]] [[package]]
name = "libffi-sys" name = "libffi2"
version = "2.3.0" version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f36115160c57e8529781b4183c2bb51fdc1f6d6d1ed345591d84be7703befb3c" checksum = "c88a3402cad8ff58216ec6d07e5ecfa9e15fc36613c0a832db541e4e1a718a7b"
dependencies = [ dependencies = [
"cc", "libc",
"libffi-sys2",
] ]
[[package]] [[package]]
@ -2273,7 +2273,7 @@ dependencies = [
"directories", "directories",
"getrandom 0.3.1", "getrandom 0.3.1",
"libc", "libc",
"libffi", "libffi2",
"libloading", "libloading",
"measureme 11.0.1", "measureme 11.0.1",
"rand 0.9.0", "rand 0.9.0",

View file

@ -814,6 +814,10 @@ fn configure_cmake(
cflags.push(s); cflags.push(s);
} }
if target.contains("ohos") {
cflags.push(" -D_LINUX_SYSINFO_H");
}
if builder.config.llvm_clang_cl.is_some() { if builder.config.llvm_clang_cl.is_some() {
cflags.push(format!(" --target={target}")); cflags.push(format!(" --target={target}"));
} }
@ -834,6 +838,11 @@ fn configure_cmake(
cxxflags.push(" "); cxxflags.push(" ");
cxxflags.push(s); cxxflags.push(s);
} }
if target.contains("ohos") {
cxxflags.push(" -D_LINUX_SYSINFO_H");
}
if builder.config.llvm_clang_cl.is_some() { if builder.config.llvm_clang_cl.is_some() {
cxxflags.push(format!(" --target={target}")); cxxflags.push(format!(" --target={target}"));
} }
@ -1220,6 +1229,10 @@ impl Step for Sanitizers {
cfg.define("COMPILER_RT_USE_LIBCXX", "OFF"); cfg.define("COMPILER_RT_USE_LIBCXX", "OFF");
cfg.define("LLVM_CONFIG_PATH", &llvm_config); cfg.define("LLVM_CONFIG_PATH", &llvm_config);
if self.target.contains("ohos") {
cfg.define("COMPILER_RT_USE_BUILTINS_LIBRARY", "ON");
}
// On Darwin targets the sanitizer runtimes are build as universal binaries. // On Darwin targets the sanitizer runtimes are build as universal binaries.
// Unfortunately sccache currently lacks support to build them successfully. // Unfortunately sccache currently lacks support to build them successfully.
// Disable compiler launcher on Darwin targets to avoid potential issues. // Disable compiler launcher on Darwin targets to avoid potential issues.

View file

@ -60,7 +60,10 @@ ENV \
ENV RUST_CONFIGURE_ARGS \ ENV RUST_CONFIGURE_ARGS \
--enable-profiler \ --enable-profiler \
--disable-docs --disable-docs \
--tools=cargo,clippy,rustdocs,rustfmt,rust-analyzer,rust-analyzer-proc-macro-srv,analysis,src,wasm-component-ld \
--enable-extended \
--enable-sanitizers
ENV SCRIPT python3 ../x.py dist --host=$TARGETS --target $TARGETS ENV SCRIPT python3 ../x.py dist --host=$TARGETS --target $TARGETS

View file

@ -1,6 +1,6 @@
# `*-unknown-linux-ohos` # `*-unknown-linux-ohos`
**Tier: 2** **Tier: 2with Host Tools**
* aarch64-unknown-linux-ohos * aarch64-unknown-linux-ohos
* armv7-unknown-linux-ohos * armv7-unknown-linux-ohos
@ -18,6 +18,17 @@ system.
- Amanieu d'Antras ([@Amanieu](https://github.com/Amanieu)) - Amanieu d'Antras ([@Amanieu](https://github.com/Amanieu))
- Lu Binglun ([@lubinglun](https://github.com/lubinglun)) - Lu Binglun ([@lubinglun](https://github.com/lubinglun))
## Requirements
All the ohos targets of Tier 2 with host tools support all extended rust tools.
(exclude `miri`, the support of `miri` will be added soon)
### Host toolchain
The targets require a reasonably up-to-date OpenHarmony SDK on the host.
The targets support `cargo`, which require [ohos-openssl](https://github.com/ohos-rs/ohos-openssl).
## Setup ## Setup
The OpenHarmony SDK doesn't currently support Rust compilation directly, so The OpenHarmony SDK doesn't currently support Rust compilation directly, so

@ -1 +1 @@
Subproject commit 48664a6cab29d48138ffa004b7978d52ef73e3ac Subproject commit fd3498bff0b939dda91d56960acc33d55f2f9cdf

@ -1 +1 @@
Subproject commit 1c3bb96fdb6db7b8e8f24edb016099c223fdd27e Subproject commit 92e80685d0d5dcea3ccf321995c43b72338639c6

@ -1 +1 @@
Subproject commit 2622e844bc1e2e6123e54e94e4706f7b6195ce3d Subproject commit ce948f4616e3d4277e30c75c8bb01e094910df39

@ -1 +1 @@
Subproject commit a35f4f773118ccfbd8d05102eb12a34097b1ee55 Subproject commit 5004a8f6f5d8468b64fae457afb7d96e1784c783