forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#120585 - Amanieu:ohos-tier2, r=<try>
Promote OpenHarmony targets to tier 2 MCP: rust-lang/compiler-team#719
- Loading branch information
Showing
13 changed files
with
125 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
FROM ubuntu:23.04 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
g++ \ | ||
make \ | ||
ninja-build \ | ||
file \ | ||
curl \ | ||
ca-certificates \ | ||
python3 \ | ||
git \ | ||
cmake \ | ||
sudo \ | ||
gdb \ | ||
libssl-dev \ | ||
pkg-config \ | ||
xz-utils \ | ||
unzip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY scripts/ohos-sdk.sh /scripts/ | ||
RUN sh /scripts/ohos-sdk.sh | ||
|
||
COPY scripts/ohos/aarch64-unknown-linux-ohos-clang.sh /usr/local/bin/ | ||
COPY scripts/ohos/aarch64-unknown-linux-ohos-clang++.sh /usr/local/bin/ | ||
COPY scripts/ohos/armv7-unknown-linux-ohos-clang.sh /usr/local/bin/ | ||
COPY scripts/ohos/armv7-unknown-linux-ohos-clang++.sh /usr/local/bin/ | ||
COPY scripts/ohos/x86_64-unknown-linux-ohos-clang.sh /usr/local/bin/ | ||
COPY scripts/ohos/x86_64-unknown-linux-ohos-clang++.sh /usr/local/bin/ | ||
|
||
# env | ||
ENV TARGETS=aarch64-unknown-linux-ohos | ||
ENV TARGETS=$TARGETS,armv7-unknown-linux-ohos | ||
ENV TARGETS=$TARGETS,x86_64-unknown-linux-ohos | ||
|
||
ENV \ | ||
CC_aarch64_unknown_linux_ohos=/usr/local/bin/aarch64-unknown-linux-ohos-clang.sh \ | ||
AR_aarch64_unknown_linux_ohos=/opt/ohos-sdk/native/llvm/bin/llvm-ar \ | ||
CXX_aarch64_unknown_linux_ohos=/usr/local/bin/aarch64-unknown-linux-ohos-clang++.sh | ||
ENV \ | ||
CC_armv7_unknown_linux_ohos=/usr/local/bin/armv7-unknown-linux-ohos-clang.sh \ | ||
AR_armv7_unknown_linux_ohos=/opt/ohos-sdk/native/llvm/bin/llvm-ar \ | ||
CXX_armv7_unknown_linux_ohos=/usr/local/bin/armv7-unknown-linux-ohos-clang++.sh | ||
ENV \ | ||
CC_x86_64_unknown_linux_ohos=/usr/local/bin/x86_64-unknown-linux-ohos-clang.sh \ | ||
AR_x86_64_unknown_linux_ohos=/opt/ohos-sdk/native/llvm/bin/llvm-ar \ | ||
CXX_x86_64_unknown_linux_ohos=/usr/local/bin/x86_64-unknown-linux-ohos-clang++.sh | ||
|
||
ENV RUST_CONFIGURE_ARGS \ | ||
--enable-profiler \ | ||
--disable-docs | ||
|
||
ENV SCRIPT python3 ../x.py dist --host='' --target $TARGETS | ||
|
||
COPY scripts/sccache.sh /scripts/ | ||
RUN sh /scripts/sccache.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
set -ex | ||
|
||
curl https://repo.huaweicloud.com/openharmony/os/4.0-Release/ohos-sdk-windows_linux-public.tar.gz | \ | ||
tar xz -C /tmp ohos-sdk/linux/native-linux-x64-4.0.10.13-Release.zip | ||
mkdir /opt/ohos-sdk | ||
cd /opt/ohos-sdk | ||
unzip -qq /tmp/ohos-sdk/linux/native-linux-x64-4.0.10.13-Release.zip |
6 changes: 6 additions & 0 deletions
6
src/ci/docker/scripts/ohos/aarch64-unknown-linux-ohos-clang++.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
exec /opt/ohos-sdk/native/llvm/bin/clang++ \ | ||
-target aarch64-linux-ohos \ | ||
--sysroot=/opt/ohos-sdk/native/sysroot \ | ||
-D__MUSL__ \ | ||
"$@" |
6 changes: 6 additions & 0 deletions
6
src/ci/docker/scripts/ohos/aarch64-unknown-linux-ohos-clang.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
exec /opt/ohos-sdk/native/llvm/bin/clang \ | ||
-target aarch64-linux-ohos \ | ||
--sysroot=/opt/ohos-sdk/native/sysroot \ | ||
-D__MUSL__ \ | ||
"$@" |
10 changes: 10 additions & 0 deletions
10
src/ci/docker/scripts/ohos/armv7-unknown-linux-ohos-clang++.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
exec /opt/ohos-sdk/native/llvm/bin/clang++ \ | ||
-target arm-linux-ohos \ | ||
--sysroot=/opt/ohos-sdk/native/sysroot \ | ||
-D__MUSL__ \ | ||
-march=armv7-a \ | ||
-mfloat-abi=softfp \ | ||
-mtune=generic-armv7-a \ | ||
-mthumb \ | ||
"$@" |
10 changes: 10 additions & 0 deletions
10
src/ci/docker/scripts/ohos/armv7-unknown-linux-ohos-clang.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
exec /opt/ohos-sdk/native/llvm/bin/clang \ | ||
-target arm-linux-ohos \ | ||
--sysroot=/opt/ohos-sdk/native/sysroot \ | ||
-D__MUSL__ \ | ||
-march=armv7-a \ | ||
-mfloat-abi=softfp \ | ||
-mtune=generic-armv7-a \ | ||
-mthumb \ | ||
"$@" |
6 changes: 6 additions & 0 deletions
6
src/ci/docker/scripts/ohos/x86_64-unknown-linux-ohos-clang++.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
exec /opt/ohos-sdk/native/llvm/bin/clang++ \ | ||
-target x86_64-linux-ohos \ | ||
--sysroot=/opt/ohos-sdk/native/sysroot \ | ||
-D__MUSL__ \ | ||
"$@" |
6 changes: 6 additions & 0 deletions
6
src/ci/docker/scripts/ohos/x86_64-unknown-linux-ohos-clang.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
exec /opt/ohos-sdk/native/llvm/bin/clang \ | ||
-target x86_64-linux-ohos \ | ||
--sysroot=/opt/ohos-sdk/native/sysroot \ | ||
-D__MUSL__ \ | ||
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters