about summary refs log tree commit diff
path: root/src/bootstrap
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 /src/bootstrap
parent4dab55bcaa3f1a60f11b3ff36159c199bc210616 (diff)
downloadrust-3eb04fd590527a103a70027a9da5ed9b20b76238.tar.gz
rust-3eb04fd590527a103a70027a9da5ed9b20b76238.zip
add support for extend rust tools and sanitizer
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/src/core/build_steps/llvm.rs11
1 files changed, 10 insertions, 1 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.