about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLuuuXXX <luuux98@163.com>2025-03-04 17:55:06 +0800
committerLuuuXXX <luuux98@163.com>2025-03-04 17:55:06 +0800
commit3eb04fd590527a103a70027a9da5ed9b20b76238 (patch)
tree8e2f21a035ce8272bf306e65dd9f84088fdc87eb
parent4dab55bcaa3f1a60f11b3ff36159c199bc210616 (diff)
downloadrust-3eb04fd590527a103a70027a9da5ed9b20b76238.tar.gz
rust-3eb04fd590527a103a70027a9da5ed9b20b76238.zip
add support for extend rust tools and sanitizer
-rw-r--r--src/bootstrap/src/core/build_steps/llvm.rs11
-rw-r--r--src/ci/docker/host-x86_64/dist-ohos/Dockerfile5
-rw-r--r--src/doc/rustc/src/platform-support/openharmony.md13
3 files changed, 26 insertions, 3 deletions
diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs
index 5919e989b34..3a32487a17c 100644
--- a/src/bootstrap/src/core/build_steps/llvm.rs
+++ b/src/bootstrap/src/core/build_steps/llvm.rs
@@ -813,7 +813,9 @@ fn configure_cmake(
         cflags.push(" ");
         cflags.push(s);
     }
-
+    if target.contains("ohos") {
+        cflags.push(" -D_LINUX_SYSINFO_H");
+    }
     if builder.config.llvm_clang_cl.is_some() {
         cflags.push(format!(" --target={target}"));
     }
@@ -834,6 +836,9 @@ fn configure_cmake(
         cxxflags.push(" ");
         cxxflags.push(s);
     }
+    if target.contains("ohos") {
+        cxxflags.push(" -D_LINUX_SYSINFO_H");
+    }
     if builder.config.llvm_clang_cl.is_some() {
         cxxflags.push(format!(" --target={target}"));
     }
@@ -1220,6 +1225,10 @@ impl Step for Sanitizers {
         cfg.define("COMPILER_RT_USE_LIBCXX", "OFF");
         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.
         // Unfortunately sccache currently lacks support to build them successfully.
         // Disable compiler launcher on Darwin targets to avoid potential issues.
diff --git a/src/ci/docker/host-x86_64/dist-ohos/Dockerfile b/src/ci/docker/host-x86_64/dist-ohos/Dockerfile
index 23c0c8b49d2..2c514fa0d4d 100644
--- a/src/ci/docker/host-x86_64/dist-ohos/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-ohos/Dockerfile
@@ -60,7 +60,10 @@ ENV \
 
 ENV RUST_CONFIGURE_ARGS \
     --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
 
diff --git a/src/doc/rustc/src/platform-support/openharmony.md b/src/doc/rustc/src/platform-support/openharmony.md
index 1632f44aeec..a2107b48a86 100644
--- a/src/doc/rustc/src/platform-support/openharmony.md
+++ b/src/doc/rustc/src/platform-support/openharmony.md
@@ -1,6 +1,6 @@
 # `*-unknown-linux-ohos`
 
-**Tier: 2**
+**Tier: 2 (with Host Tools)**
 
 * aarch64-unknown-linux-ohos
 * armv7-unknown-linux-ohos
@@ -18,6 +18,17 @@ system.
 - Amanieu d'Antras ([@Amanieu](https://github.com/Amanieu))
 - 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
 
 The OpenHarmony SDK doesn't currently support Rust compilation directly, so