Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7e6a6d0

Browse files
authoredMar 8, 2024
Rollup merge of #121832 - heiher:loongarch64-musl, r=wesleywiser
Add new Tier-3 target: `loongarch64-unknown-linux-musl` MCP: rust-lang/compiler-team#518
2 parents b1aca86 + 36d271f commit 7e6a6d0

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed
 

‎compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,7 @@ supported_targets! {
14041404
("i686-unknown-linux-gnu", i686_unknown_linux_gnu),
14051405
("i586-unknown-linux-gnu", i586_unknown_linux_gnu),
14061406
("loongarch64-unknown-linux-gnu", loongarch64_unknown_linux_gnu),
1407+
("loongarch64-unknown-linux-musl", loongarch64_unknown_linux_musl),
14071408
("m68k-unknown-linux-gnu", m68k_unknown_linux_gnu),
14081409
("csky-unknown-linux-gnuabiv2", csky_unknown_linux_gnuabiv2),
14091410
("csky-unknown-linux-gnuabiv2hf", csky_unknown_linux_gnuabiv2hf),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
use crate::spec::{base, Target, TargetOptions};
2+
3+
pub fn target() -> Target {
4+
Target {
5+
llvm_target: "loongarch64-unknown-linux-musl".into(),
6+
description: None,
7+
pointer_width: 64,
8+
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".into(),
9+
arch: "loongarch64".into(),
10+
options: TargetOptions {
11+
cpu: "generic".into(),
12+
features: "+f,+d".into(),
13+
llvm_abiname: "lp64d".into(),
14+
max_atomic_width: Some(64),
15+
crt_static_default: false,
16+
..base::linux_musl::opts()
17+
},
18+
}
19+
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ target | std | notes
165165
`i686-unknown-freebsd` | ✓ | 32-bit FreeBSD [^x86_32-floats-return-ABI]
166166
`i686-unknown-linux-musl` | ✓ | 32-bit Linux with musl 1.2.3 [^x86_32-floats-return-ABI]
167167
[`i686-unknown-uefi`](platform-support/unknown-uefi.md) | * | 32-bit UEFI
168+
[`loongarch64-unknown-linux-musl`](platform-support/loongarch-linux.md) | ? | | LoongArch64 Linux (LP64D ABI) with musl 1.2.3
168169
[`loongarch64-unknown-none`](platform-support/loongarch-none.md) | * | | LoongArch64 Bare-metal (LP64D ABI)
169170
[`loongarch64-unknown-none-softfloat`](platform-support/loongarch-none.md) | * | | LoongArch64 Bare-metal (LP64S ABI)
170171
[`nvptx64-nvidia-cuda`](platform-support/nvptx64-nvidia-cuda.md) | * | --emit=asm generates PTX code that [runs on NVIDIA GPUs]

‎tests/assembly/targets/targets-elf.rs

+3
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@
234234
//@ revisions: loongarch64_unknown_linux_gnu
235235
//@ [loongarch64_unknown_linux_gnu] compile-flags: --target loongarch64-unknown-linux-gnu
236236
//@ [loongarch64_unknown_linux_gnu] needs-llvm-components: loongarch
237+
//@ revisions: loongarch64_unknown_linux_musl
238+
//@ [loongarch64_unknown_linux_musl] compile-flags: --target loongarch64-unknown-linux-musl
239+
//@ [loongarch64_unknown_linux_musl] needs-llvm-components: loongarch
237240
//@ revisions: loongarch64_unknown_none
238241
//@ [loongarch64_unknown_none] compile-flags: --target loongarch64-unknown-none
239242
//@ [loongarch64_unknown_none] needs-llvm-components: loongarch

0 commit comments

Comments
 (0)
Failed to load comments.