diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-23 23:49:12 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-23 23:49:12 -0400 |
| commit | 4d0b44ab5b5ce21671ca64e15c22b299f2ed4985 (patch) | |
| tree | b74752e89e3787856931f08d49cb74ea87f8f66e /compiler/rustc_target/src | |
| parent | ec1ccff8ce77d09594019c94788e95bb9487ae54 (diff) | |
| parent | 9ab704612abedbe13fc01a878ea7a3f76c52449e (diff) | |
| download | rust-4d0b44ab5b5ce21671ca64e15c22b299f2ed4985.tar.gz rust-4d0b44ab5b5ce21671ca64e15c22b299f2ed4985.zip | |
Rollup merge of #130750 - heiher:loong-linux-ohos-tier3, r=jieyouxu
Add new Tier-3 target: `loongarch64-unknown-linux-ohos` MCP: https://github.com/rust-lang/compiler-team/issues/784
Diffstat (limited to 'compiler/rustc_target/src')
| -rw-r--r-- | compiler/rustc_target/src/spec/mod.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_ohos.rs | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index fbf1c8d6010..3f0b23a595c 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1882,6 +1882,7 @@ supported_targets! { ("aarch64-unknown-linux-ohos", aarch64_unknown_linux_ohos), ("armv7-unknown-linux-ohos", armv7_unknown_linux_ohos), + ("loongarch64-unknown-linux-ohos", loongarch64_unknown_linux_ohos), ("x86_64-unknown-linux-ohos", x86_64_unknown_linux_ohos), ("x86_64-unknown-linux-none", x86_64_unknown_linux_none), diff --git a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_ohos.rs b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_ohos.rs new file mode 100644 index 00000000000..f9f7098684e --- /dev/null +++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_ohos.rs @@ -0,0 +1,24 @@ +use crate::spec::{Target, TargetOptions, base}; + +pub(crate) fn target() -> Target { + Target { + // LLVM 15 doesn't support OpenHarmony yet, use a linux target instead. + llvm_target: "loongarch64-unknown-linux-musl".into(), + metadata: crate::spec::TargetMetadata { + description: Some("LoongArch64 OpenHarmony".into()), + tier: Some(3), + host_tools: Some(false), + std: Some(true), + }, + pointer_width: 64, + data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(), + arch: "loongarch64".into(), + options: TargetOptions { + cpu: "generic".into(), + features: "+f,+d".into(), + llvm_abiname: "lp64d".into(), + max_atomic_width: Some(64), + ..base::linux_ohos::opts() + }, + } +} |
