Skip to content

Commit 6efacfb

Browse files
committed
add fix for full tools and sanitizer
1 parent 7279acf commit 6efacfb

File tree

8 files changed

+43
-16
lines changed

8 files changed

+43
-16
lines changed

Cargo.lock

+10-10
Original file line numberDiff line numberDiff line change
@@ -1997,22 +1997,22 @@ dependencies = [
19971997
]
19981998

19991999
[[package]]
2000-
name = "libffi"
2001-
version = "3.2.0"
2000+
name = "libffi-sys2"
2001+
version = "2.4.0"
20022002
source = "registry+https://github.com/rust-lang/crates.io-index"
2003-
checksum = "ce826c243048e3d5cec441799724de52e2d42f820468431fc3fceee2341871e2"
2003+
checksum = "47aedd9774ffb3dcab5c96f593cb5a0caf421a5e38b16bab3b8cdef5facb6ea2"
20042004
dependencies = [
2005-
"libc",
2006-
"libffi-sys",
2005+
"cc",
20072006
]
20082007

20092008
[[package]]
2010-
name = "libffi-sys"
2011-
version = "2.3.0"
2009+
name = "libffi2"
2010+
version = "3.3.0"
20122011
source = "registry+https://github.com/rust-lang/crates.io-index"
2013-
checksum = "f36115160c57e8529781b4183c2bb51fdc1f6d6d1ed345591d84be7703befb3c"
2012+
checksum = "c88a3402cad8ff58216ec6d07e5ecfa9e15fc36613c0a832db541e4e1a718a7b"
20142013
dependencies = [
2015-
"cc",
2014+
"libc",
2015+
"libffi-sys2",
20162016
]
20172017

20182018
[[package]]
@@ -2273,7 +2273,7 @@ dependencies = [
22732273
"directories",
22742274
"getrandom 0.3.1",
22752275
"libc",
2276-
"libffi",
2276+
"libffi2",
22772277
"libloading",
22782278
"measureme 11.0.1",
22792279
"rand 0.9.0",

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

+13
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

+4-1
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,rust-analyzer,rust-analyzer-proc-macro-srv,analysis,src,wasm-component-ld \
65+
--enable-extended \
66+
--enable-sanitizers
6467

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

src/doc/rustc/src/platform-support/openharmony.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `*-unknown-linux-ohos`
22

3-
**Tier: 2**
3+
**Tier: 2(with Host Tools)**
44

55
* aarch64-unknown-linux-ohos
66
* armv7-unknown-linux-ohos
@@ -18,6 +18,17 @@ system.
1818
- Amanieu d'Antras ([@Amanieu](https://github.com/Amanieu))
1919
- Lu Binglun ([@lubinglun](https://github.com/lubinglun))
2020

21+
## Requirements
22+
23+
All the ohos targets of Tier 2 with host tools support all extended rust tools.
24+
(exclude `miri`, the support of `miri` will be added soon)
25+
26+
### Host toolchain
27+
28+
The targets require a reasonably up-to-date OpenHarmony SDK on the host.
29+
30+
The targets support `cargo`, which require [ohos-openssl](https://github.com/ohos-rs/ohos-openssl).
31+
2132
## Setup
2233

2334
The OpenHarmony SDK doesn't currently support Rust compilation directly, so

src/gcc

Submodule gcc updated 19135 files

src/llvm-project

Submodule llvm-project updated 211 files

src/tools/cargo

Submodule cargo updated 73 files

0 commit comments

Comments
 (0)