Skip to content

Commit 66aaa16

Browse files
committed
promote ohos targets to tier to with host tools
1 parent 92bedea commit 66aaa16

File tree

10 files changed

+54
-14
lines changed

10 files changed

+54
-14
lines changed

Cargo.lock

+17-3
Original file line numberDiff line numberDiff line change
@@ -2270,6 +2270,20 @@ dependencies = [
22702270
"smallvec",
22712271
]
22722272

2273+
[[package]]
2274+
name = "measureme-mirror"
2275+
version = "12.0.1"
2276+
source = "registry+https://github.com/rust-lang/crates.io-index"
2277+
checksum = "fe110855993552cfa51a5018e8cdf2acf7f948c46136322017a9a8484ffc5ea8"
2278+
dependencies = [
2279+
"log",
2280+
"memmap2",
2281+
"parking_lot",
2282+
"perf-event-open-sys",
2283+
"rustc-hash 1.1.0",
2284+
"smallvec",
2285+
]
2286+
22732287
[[package]]
22742288
name = "memchr"
22752289
version = "2.7.4"
@@ -3534,7 +3548,7 @@ dependencies = [
35343548
"gimli 0.30.0",
35353549
"itertools",
35363550
"libc",
3537-
"measureme",
3551+
"measureme-mirror",
35383552
"object 0.36.7",
35393553
"rustc-demangle",
35403554
"rustc_abi",
@@ -3650,7 +3664,7 @@ dependencies = [
36503664
"indexmap",
36513665
"jobserver",
36523666
"libc",
3653-
"measureme",
3667+
"measureme-mirror",
36543668
"memmap2",
36553669
"parking_lot",
36563670
"portable-atomic",
@@ -4403,7 +4417,7 @@ dependencies = [
44034417
name = "rustc_query_impl"
44044418
version = "0.0.0"
44054419
dependencies = [
4406-
"measureme",
4420+
"measureme-mirror",
44074421
"rustc_data_structures",
44084422
"rustc_errors",
44094423
"rustc_hir",

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
@@ -237,7 +237,7 @@ fn main() {
237237
println!("cargo:rustc-link-lib=kstat");
238238
}
239239

240-
if (target.starts_with("arm") && !target.contains("freebsd"))
240+
if (target.starts_with("arm") && !target.contains("freebsd")) && !target.contains("ohos")
241241
|| target.starts_with("mips-")
242242
|| target.starts_with("mipsel-")
243243
|| target.starts_with("powerpc-")
@@ -367,6 +367,7 @@ fn main() {
367367
|| target.contains("freebsd")
368368
|| target.contains("windows-gnullvm")
369369
|| target.contains("aix")
370+
|| target.contains("ohos")
370371
{
371372
"c++"
372373
} else if target.contains("netbsd") && llvm_static_stdcpp.is_some() {

compiler/rustc_query_impl/Cargo.toml

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

66
[dependencies]
77
# tidy-alphabetical-start
8-
measureme = "11"
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" }
910
rustc_data_structures = { path = "../rustc_data_structures" }
1011
rustc_errors = { path = "../rustc_errors" }
1112
rustc_hir = { path = "../rustc_hir" }

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

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

472+
if target.starts_with("x86_64") && target.contains("ohos") {
473+
cfg.define("LLVM_TOOL_LLVM_RTDYLD_BUILD", "OFF");
474+
}
475+
472476
let mut enabled_llvm_projects = Vec::new();
473477

474478
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)