Skip to content

Commit 6324b39

Browse files
committed
promote ohos targets to tier to with host tools
1 parent fd17dea commit 6324b39

File tree

10 files changed

+54
-16
lines changed

10 files changed

+54
-16
lines changed

Cargo.lock

+17-4
Original file line numberDiff line numberDiff line change
@@ -2178,6 +2178,20 @@ dependencies = [
21782178
"smallvec",
21792179
]
21802180

2181+
[[package]]
2182+
name = "measureme-mirror"
2183+
version = "12.0.1"
2184+
source = "registry+https://github.com/rust-lang/crates.io-index"
2185+
checksum = "fe110855993552cfa51a5018e8cdf2acf7f948c46136322017a9a8484ffc5ea8"
2186+
dependencies = [
2187+
"log",
2188+
"memmap2",
2189+
"parking_lot",
2190+
"perf-event-open-sys",
2191+
"rustc-hash 1.1.0",
2192+
"smallvec",
2193+
]
2194+
21812195
[[package]]
21822196
name = "memchr"
21832197
version = "2.7.4"
@@ -3365,7 +3379,7 @@ dependencies = [
33653379
"gimli 0.30.0",
33663380
"itertools",
33673381
"libc",
3368-
"measureme",
3382+
"measureme-mirror",
33693383
"object 0.36.7",
33703384
"rustc-demangle",
33713385
"rustc_abi",
@@ -3483,7 +3497,7 @@ dependencies = [
34833497
"indexmap",
34843498
"jobserver",
34853499
"libc",
3486-
"measureme",
3500+
"measureme-mirror",
34873501
"memmap2",
34883502
"parking_lot",
34893503
"portable-atomic",
@@ -4249,8 +4263,7 @@ dependencies = [
42494263
name = "rustc_query_impl"
42504264
version = "0.0.0"
42514265
dependencies = [
4252-
"measureme",
4253-
"rustc_attr_data_structures",
4266+
"measureme-mirror",
42544267
"rustc_data_structures",
42554268
"rustc_errors",
42564269
"rustc_hashes",

compiler/rustc_codegen_llvm/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ bitflags = "2.4.1"
1414
gimli = "0.30"
1515
itertools = "0.12"
1616
libc = "0.2"
17-
measureme = "11"
17+
# FIXME: waiting for the new version of measureme. (https://github.com/rust-lang/measureme/pull/240)
18+
measureme = { package = "measureme-mirror", version = "12.0.1" }
1819
object = { version = "0.36.3", default-features = false, features = ["std", "read"] }
1920
rustc-demangle = "0.1.21"
2021
rustc_abi = { path = "../rustc_abi" }

compiler/rustc_data_structures/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ elsa = "1.11.0"
1212
ena = "0.14.3"
1313
indexmap = "2.4.0"
1414
jobserver_crate = { version = "0.1.28", package = "jobserver" }
15-
measureme = "11"
15+
# FIXME: waiting for the new version of measureme. (https://github.com/rust-lang/measureme/pull/240)
16+
measureme = { package = "measureme-mirror", version = "12.0.1" }
1617
rustc-hash = "2.0.0"
1718
rustc-rayon = { version = "0.5.1", features = ["indexmap"] }
1819
rustc-stable-hash = { version = "0.1.0", features = ["nightly"] }

compiler/rustc_llvm/build.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ fn main() {
241241
println!("cargo:rustc-link-lib=kstat");
242242
}
243243

244-
if (target.starts_with("arm") && !target.contains("freebsd"))
244+
if (target.starts_with("arm") && !target.contains("freebsd")) && !target.contains("ohos")
245245
|| target.starts_with("mips-")
246246
|| target.starts_with("mipsel-")
247247
|| target.starts_with("powerpc-")
@@ -371,6 +371,7 @@ fn main() {
371371
|| target.contains("freebsd")
372372
|| target.contains("windows-gnullvm")
373373
|| target.contains("aix")
374+
|| target.contains("ohos")
374375
{
375376
"c++"
376377
} else if target.contains("netbsd") && llvm_static_stdcpp.is_some() {

compiler/rustc_query_impl/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
measureme = "11"
9-
rustc_attr_data_structures = { path = "../rustc_attr_data_structures" }
8+
# FIXME: waiting for the new version of measureme. (https://github.com/rust-lang/measureme/pull/240)
9+
measureme = { package = "measureme-mirror", version = "12.0.1" }
1010
rustc_data_structures = { path = "../rustc_data_structures" }
1111
rustc_errors = { path = "../rustc_errors" }
1212
rustc_hashes = { path = "../rustc_hashes" }

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

+4
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,10 @@ impl Step for Llvm {
471471
cfg.define("LLVM_BUILD_32_BITS", "ON");
472472
}
473473

474+
if target.starts_with("x86_64") && target.contains("ohos") {
475+
cfg.define("LLVM_TOOL_LLVM_RTDYLD_BUILD", "OFF");
476+
}
477+
474478
let mut enabled_llvm_projects = Vec::new();
475479

476480
if helpers::forcing_clang_based_tests() {

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

+12-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2222
COPY scripts/ohos-sdk.sh /scripts/
2323
RUN sh /scripts/ohos-sdk.sh
2424

25+
COPY scripts/ohos-openssl.sh /scripts/
26+
RUN sh /scripts/ohos-openssl.sh
27+
2528
COPY scripts/ohos/aarch64-unknown-linux-ohos-clang.sh /usr/local/bin/
2629
COPY scripts/ohos/aarch64-unknown-linux-ohos-clang++.sh /usr/local/bin/
2730
COPY scripts/ohos/armv7-unknown-linux-ohos-clang.sh /usr/local/bin/
@@ -30,6 +33,14 @@ COPY scripts/ohos/x86_64-unknown-linux-ohos-clang.sh /usr/local/bin/
3033
COPY scripts/ohos/x86_64-unknown-linux-ohos-clang++.sh /usr/local/bin/
3134

3235
# env
36+
ENV AARCH64_UNKNOWN_LINUX_OHOS_OPENSSL_DIR=/opt/ohos-openssl/prelude/arm64-v8a
37+
ENV ARMV7_UNKNOWN_LINUX_OHOS_OPENSSL_DIR=/opt/ohos-openssl/prelude/armeabi-v7a
38+
ENV X86_64_UNKNOWN_LINUX_OHOS_OPENSSL_DIR=/opt/ohos-openssl/prelude/x86_64
39+
40+
ENV AARCH64_UNKNOWN_LINUX_OHOS_OPENSSL_NO_VENDOR=1
41+
ENV ARMV7_UNKNOWN_LINUX_OHOS_OPENSSL_NO_VENDOR=1
42+
ENV X86_64_UNKNOWN_LINUX_OHOS_OPENSSL_NO_VENDOR=1
43+
3344
ENV TARGETS=aarch64-unknown-linux-ohos
3445
ENV TARGETS=$TARGETS,armv7-unknown-linux-ohos
3546
ENV TARGETS=$TARGETS,x86_64-unknown-linux-ohos
@@ -51,7 +62,7 @@ ENV RUST_CONFIGURE_ARGS \
5162
--enable-profiler \
5263
--disable-docs
5364

54-
ENV SCRIPT python3 ../x.py dist --host='' --target $TARGETS
65+
ENV SCRIPT python3 ../x.py dist --host=$TARGETS --target $TARGETS
5566

5667
COPY scripts/sccache.sh /scripts/
5768
RUN sh /scripts/sccache.sh

src/ci/docker/scripts/ohos-openssl.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
set -ex
3+
4+
URL=https://github.com/ohos-rs/ohos-openssl/archive/refs/tags/0.1.0.tar.gz
5+
6+
mkdir -p /opt/ohos-openssl
7+
curl -fL $URL | tar xz -C /opt/ohos-openssl --strip-components=1

src/ci/docker/scripts/ohos-sdk.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/sh
22
set -ex
33

4-
URL=https://repo.huaweicloud.com/openharmony/os/4.0-Release/ohos-sdk-windows_linux-public.tar.gz
4+
URL=https://repo.huaweicloud.com/openharmony/os/5.0.0-Release/ohos-sdk-windows_linux-public.tar.gz
55

6-
curl $URL | tar xz -C /tmp ohos-sdk/linux/native-linux-x64-4.0.10.13-Release.zip
6+
curl $URL | tar xz -C /tmp linux/native-linux-x64-5.0.0.71-Release.zip
77
mkdir /opt/ohos-sdk
88
cd /opt/ohos-sdk
9-
unzip -qq /tmp/ohos-sdk/linux/native-linux-x64-4.0.10.13-Release.zip
9+
unzip -qq /tmp/linux/native-linux-x64-5.0.0.71-Release.zip

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ target | notes
8989
-------|-------
9090
`aarch64-pc-windows-msvc` | ARM64 Windows MSVC
9191
`aarch64-unknown-linux-musl` | ARM64 Linux with musl 1.2.3
92+
[`aarch64-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | ARM64 OpenHarmony
9293
`arm-unknown-linux-gnueabi` | Armv6 Linux (kernel 3.2, glibc 2.17)
9394
`arm-unknown-linux-gnueabihf` | Armv6 Linux, hardfloat (kernel 3.2, glibc 2.17)
9495
`armv7-unknown-linux-gnueabihf` | Armv7-A Linux, hardfloat (kernel 3.2, glibc 2.17)
96+
[`armv7-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | Armv7-A OpenHarmony
9597
[`loongarch64-unknown-linux-gnu`](platform-support/loongarch-linux.md) | LoongArch64 Linux, LP64D ABI (kernel 5.19, glibc 2.36)
9698
[`loongarch64-unknown-linux-musl`](platform-support/loongarch-linux.md) | LoongArch64 Linux, LP64D ABI (kernel 5.19, musl 1.2.5)
9799
`powerpc-unknown-linux-gnu` | PowerPC Linux (kernel 3.2, glibc 2.17)
@@ -104,6 +106,7 @@ target | notes
104106
[`x86_64-unknown-freebsd`](platform-support/freebsd.md) | 64-bit x86 FreeBSD
105107
[`x86_64-unknown-illumos`](platform-support/illumos.md) | illumos
106108
`x86_64-unknown-linux-musl` | 64-bit Linux with musl 1.2.3
109+
[`x86_64-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | x86_64 OpenHarmony
107110
[`x86_64-unknown-netbsd`](platform-support/netbsd.md) | NetBSD/amd64
108111

109112
## Tier 2 without Host Tools
@@ -142,7 +145,6 @@ target | std | notes
142145
[`aarch64-linux-android`](platform-support/android.md) | ✓ | ARM64 Android
143146
[`aarch64-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | ARM64 MinGW (Windows 10+), LLVM ABI
144147
[`aarch64-unknown-fuchsia`](platform-support/fuchsia.md) | ✓ | ARM64 Fuchsia
145-
[`aarch64-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | ARM64 OpenHarmony
146148
`aarch64-unknown-none` | * | Bare ARM64, hardfloat
147149
`aarch64-unknown-none-softfloat` | * | Bare ARM64, softfloat
148150
[`aarch64-unknown-uefi`](platform-support/unknown-uefi.md) | ? | ARM64 UEFI
@@ -158,7 +160,6 @@ target | std | notes
158160
`armv7-unknown-linux-gnueabi` | ✓ | Armv7-A Linux (kernel 4.15, glibc 2.27)
159161
`armv7-unknown-linux-musleabi` | ✓ | Armv7-A Linux with musl 1.2.3
160162
`armv7-unknown-linux-musleabihf` | ✓ | Armv7-A Linux with musl 1.2.3, hardfloat
161-
[`armv7-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | Armv7-A OpenHarmony
162163
[`armv7a-none-eabi`](platform-support/arm-none-eabi.md) | * | Bare Armv7-A
163164
[`armv7r-none-eabi`](platform-support/armv7r-none-eabi.md) | * | Bare Armv7-R
164165
[`armv7r-none-eabihf`](platform-support/armv7r-none-eabi.md) | * | Bare Armv7-R, hardfloat
@@ -205,7 +206,6 @@ target | std | notes
205206
[`x86_64-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | 64-bit x86 MinGW (Windows 10+), LLVM ABI
206207
[`x86_64-unknown-fuchsia`](platform-support/fuchsia.md) | ✓ | 64-bit x86 Fuchsia
207208
`x86_64-unknown-linux-gnux32` | ✓ | 64-bit Linux (x32 ABI) (kernel 4.15, glibc 2.27)
208-
[`x86_64-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | x86_64 OpenHarmony
209209
[`x86_64-unknown-none`](platform-support/x86_64-unknown-none.md) | * | Freestanding/bare-metal x86_64, softfloat
210210
[`x86_64-unknown-redox`](platform-support/redox.md) | ✓ | Redox OS
211211
[`x86_64-unknown-uefi`](platform-support/unknown-uefi.md) | ? | 64-bit UEFI

0 commit comments

Comments
 (0)