Skip to content

Commit 4a4cdf0

Browse files
committed
add fix for full tools and sanitizer
1 parent 34d898a commit 4a4cdf0

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/bootstrap/src/core/build_steps/llvm.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,10 @@ fn configure_cmake(
814814
cflags.push(s);
815815
}
816816

817+
if target.contains("ohos") {
818+
cflags.push(" -D_LINUX_SYSINFO_H");
819+
}
820+
817821
if builder.config.llvm_clang_cl.is_some() {
818822
cflags.push(format!(" --target={target}"));
819823
}
@@ -834,6 +838,11 @@ fn configure_cmake(
834838
cxxflags.push(" ");
835839
cxxflags.push(s);
836840
}
841+
842+
if target.contains("ohos") {
843+
cxxflags.push(" -D_LINUX_SYSINFO_H");
844+
}
845+
837846
if builder.config.llvm_clang_cl.is_some() {
838847
cxxflags.push(format!(" --target={target}"));
839848
}
@@ -1220,6 +1229,10 @@ impl Step for Sanitizers {
12201229
cfg.define("COMPILER_RT_USE_LIBCXX", "OFF");
12211230
cfg.define("LLVM_CONFIG_PATH", &llvm_config);
12221231

1232+
if self.target.contains("ohos") {
1233+
cfg.define("COMPILER_RT_USE_BUILTINS_LIBRARY", "ON");
1234+
}
1235+
12231236
// On Darwin targets the sanitizer runtimes are build as universal binaries.
12241237
// Unfortunately sccache currently lacks support to build them successfully.
12251238
// Disable compiler launcher on Darwin targets to avoid potential issues.

src/ci/docker/host-x86_64/dist-ohos/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ ENV \
6060

6161
ENV RUST_CONFIGURE_ARGS \
6262
--enable-profiler \
63-
--disable-docs
63+
--disable-docs \
64+
--tools=cargo,clippy,rustdocs,rustfmt,analysis,src,wasm-component-ld \
65+
--enable-extended \
66+
--enable-sanitizers
6467

6568
ENV SCRIPT python3 ../x.py dist --host=$TARGETS --target $TARGETS
6669

0 commit comments

Comments
 (0)