diff options
| author | bors <bors@rust-lang.org> | 2024-03-14 16:36:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-14 16:36:02 +0000 |
| commit | 30f74ff0dc4d66debc8b50724c446f817e5f75f4 (patch) | |
| tree | 349f7ff26a76c5f4e827022d1f21ca6f1046d336 /src/doc | |
| parent | fe6157522848604562f83084154274c545fe3a27 (diff) | |
| parent | 02b1a91ee8fe485ab3b77100d4252094fca9b7b2 (diff) | |
| download | rust-30f74ff0dc4d66debc8b50724c446f817e5f75f4.tar.gz rust-30f74ff0dc4d66debc8b50724c446f817e5f75f4.zip | |
Auto merge of #122497 - matthiaskrgr:rollup-pg9ux4r, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #119029 (Avoid closing invalid handles) - #122238 (Document some builtin impls in the next solver) - #122247 (rustdoc-search: depth limit `T<U>` -> `U` unboxing) - #122287 (add test ensuring simd codegen checks don't run when a static assertion failed) - #122368 (chore: remove repetitive words) - #122397 (Various cleanups around the const eval query providers) - #122406 (Fix WF for `AsyncFnKindHelper` in new trait solver) - #122477 (Change some attribute to only_local) - #122482 (Ungate the `UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES` lint) - #122490 (Update build instructions for OpenHarmony) Failed merges: - #122471 (preserve span when evaluating mir::ConstOperand) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/rustc/src/platform-support/openharmony.md | 51 | ||||
| -rw-r--r-- | src/doc/rustc/src/platform-support/unknown-uefi.md | 2 |
2 files changed, 28 insertions, 25 deletions
diff --git a/src/doc/rustc/src/platform-support/openharmony.md b/src/doc/rustc/src/platform-support/openharmony.md index 9f90e741326..b2ddbfdfa29 100644 --- a/src/doc/rustc/src/platform-support/openharmony.md +++ b/src/doc/rustc/src/platform-support/openharmony.md @@ -96,9 +96,34 @@ exec /path/to/ohos-sdk/linux/native/llvm/bin/clang++ \ Future versions of the OpenHarmony SDK will avoid the need for this process. -## Building the target +## Building Rust programs + +Rustup ships pre-compiled artifacts for this target, which you can install with: +```sh +rustup target add aarch64-unknown-linux-ohos +rustup target add armv7-unknown-linux-ohos +rustup target add x86_64-unknown-linux-ohos +``` + +You will need to configure the linker to use in `~/.cargo/config.toml`: +```toml +[target.aarch64-unknown-linux-ohos] +ar = "/path/to/ohos-sdk/linux/native/llvm/bin/llvm-ar" +linker = "/path/to/aarch64-unknown-linux-ohos-clang.sh" + +[target.armv7-unknown-linux-ohos] +ar = "/path/to/ohos-sdk/linux/native/llvm/bin/llvm-ar" +linker = "/path/to/armv7-unknown-linux-ohos-clang.sh" + +[target.x86_64-unknown-linux-ohos] +ar = "/path/to/ohos-sdk/linux/native/llvm/bin/llvm-ar" +linker = "/path/to/x86_64-unknown-linux-ohos-clang.sh" +``` -To build a rust toolchain, create a `config.toml` with the following contents: +## Building the target from source + +Instead of using `rustup`, you can instead build a rust toolchain from source. +Create a `config.toml` with the following contents: ```toml profile = "compiler" @@ -130,28 +155,6 @@ ranlib = "/path/to/ohos-sdk/linux/native/llvm/bin/llvm-ranlib" linker = "/path/to/x86_64-unknown-linux-ohos-clang.sh" ``` -## Building Rust programs - -Rust does not yet ship pre-compiled artifacts for this target. To compile for -this target, you will either need to build Rust with the target enabled (see -"Building the target" above), or build your own copy of `core` by using -`build-std` or similar. - -You will need to configure the linker to use in `~/.cargo/config`: -```toml -[target.aarch64-unknown-linux-ohos] -ar = "/path/to/ohos-sdk/linux/native/llvm/bin/llvm-ar" -linker = "/path/to/aarch64-unknown-linux-ohos-clang.sh" - -[target.armv7-unknown-linux-ohos] -ar = "/path/to/ohos-sdk/linux/native/llvm/bin/llvm-ar" -linker = "/path/to/armv7-unknown-linux-ohos-clang.sh" - -[target.x86_64-unknown-linux-ohos] -ar = "/path/to/ohos-sdk/linux/native/llvm/bin/llvm-ar" -linker = "/path/to/x86_64-unknown-linux-ohos-clang.sh" -``` - ## Testing Running the Rust testsuite is possible, but currently difficult due to the way diff --git a/src/doc/rustc/src/platform-support/unknown-uefi.md b/src/doc/rustc/src/platform-support/unknown-uefi.md index 8fb155e1ffa..e6917502182 100644 --- a/src/doc/rustc/src/platform-support/unknown-uefi.md +++ b/src/doc/rustc/src/platform-support/unknown-uefi.md @@ -51,7 +51,7 @@ single stack. By default, the UEFI targets use the `link`-flavor of the LLVM linker `lld` to link binaries into the final PE32+ file suffixed with `*.efi`. The PE subsystem is set to `EFI_APPLICATION`, but can be modified by passing `/subsystem:<...>` -to the linker. Similarly, the entry-point is to to `efi_main` but can be +to the linker. Similarly, the entry-point is set to `efi_main` but can be changed via `/entry:<...>`. The panic-strategy is set to `abort`, The UEFI specification is available online for free: |
