Skip to content

Commit e2a9ce3

Browse files
committed
Support the remaining openwrt targets
They are the same as the unknown-linux ones.
1 parent ddad1e1 commit e2a9ce3

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

compiler/rustc_target/src/spec/mod.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -981,15 +981,17 @@ impl fmt::Display for StackProtector {
981981
}
982982

983983
macro_rules! supported_targets {
984-
( $(($triple:literal, $module:ident ),)+ ) => {
984+
( $(($triple:literal, $module:ident ),)+
985+
$((alias $triple_alias:literal, $module_alias:ident ),)+ ) => {
985986
$(mod $module;)+
986987

987988
/// List of supported targets
988-
pub const TARGETS: &[&str] = &[$($triple),+];
989+
pub const TARGETS: &[&str] = &[$($triple),+, $($triple_alias),+];
989990

990991
fn load_builtin(target: &str) -> Option<Target> {
991992
let mut t = match target {
992993
$( $triple => $module::target(), )+
994+
$( $triple_alias => $module_alias::target(), )+
993995
_ => return None,
994996
};
995997
t.is_builtin = true;
@@ -1252,6 +1254,13 @@ supported_targets! {
12521254

12531255
("aarch64-unknown-nto-qnx710", aarch64_unknown_nto_qnx_710),
12541256
("x86_64-pc-nto-qnx710", x86_64_pc_nto_qnx710),
1257+
(alias "mips-openwrt-linux-musl", mips_unknown_linux_musl),
1258+
(alias "mipsel-openwrt-linux-musl", mipsel_unknown_linux_musl),
1259+
(alias "aarch64-openwrt-linux-musl", aarch64_unknown_linux_musl),
1260+
(alias "armv7-openwrt-linux-musleabi", armv7_unknown_linux_musleabi),
1261+
(alias "armv7-openwrt-linux-musleabihf", armv7_unknown_linux_musleabihf),
1262+
(alias "powerpc64-openwrt-linux-musl", powerpc64_unknown_linux_musl),
1263+
(alias "x86_64-openwrt-linux-musl", x86_64_unknown_linux_musl),
12551264
}
12561265

12571266
/// Cow-Vec-Str: Cow<'static, [Cow<'static, str>]>

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

+7
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ target | std | host | notes
212212
`aarch64-apple-tvos` | * | | ARM64 tvOS
213213
[`aarch64-apple-watchos-sim`](platform-support/apple-watchos.md) | ✓ | | ARM64 Apple WatchOS Simulator
214214
[`aarch64-kmc-solid_asp3`](platform-support/kmc-solid.md) | ✓ | | ARM64 SOLID with TOPPERS/ASP3
215+
`aarch64-openwrt-linux-musl` | ✓ | ✓ | OpenWRT Linux MUSL
215216
[`aarch64-nintendo-switch-freestanding`](platform-support/aarch64-nintendo-switch-freestanding.md) | * | | ARM64 Nintendo Switch, Horizon
216217
[`aarch64-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | ✓ |
217218
[`aarch64-unknown-nto-qnx710`](platform-support/nto-qnx.md) | ? | | ARM64 QNX Neutrino 7.1 RTOS |
@@ -235,6 +236,8 @@ target | std | host | notes
235236
`armv6-unknown-netbsd-eabihf` | ? | |
236237
[`armv6k-nintendo-3ds`](platform-support/armv6k-nintendo-3ds.md) | ? | | ARMv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain)
237238
`armv7-apple-ios` | ✓ | | ARMv7 iOS, Cortex-a8
239+
`armv7-openwrt-linux-musleabi` | ✓ | ✓ | ARMv7 OpenWRT Linux MUSL
240+
`armv7-openwrt-linux-musleabihf` | ✓ | ✓ | ARMv7 + hardfloat OpenWRT Linux MUSL
238241
[`armv7-sony-vita-newlibeabihf`](platform-support/armv7-sony-vita-newlibeabihf.md) | ? | | ARM Cortex-A9 Sony PlayStation Vita (requires VITASDK toolchain)
239242
[`armv7-unknown-linux-uclibceabi`](platform-support/armv7-unknown-linux-uclibceabi.md) | ✓ | ✓ | ARMv7 Linux with uClibc, softfloat
240243
[`armv7-unknown-linux-uclibceabihf`](platform-support/armv7-unknown-linux-uclibceabihf.md) | ✓ | ? | ARMv7 Linux with uClibc, hardfloat
@@ -261,7 +264,9 @@ target | std | host | notes
261264
`i686-wrs-vxworks` | ? | |
262265
[`m68k-unknown-linux-gnu`](platform-support/m68k-unknown-linux-gnu.md) | ? | | Motorola 680x0 Linux
263266
`mips-unknown-linux-uclibc` | ✓ | | MIPS Linux with uClibc
267+
`mips-openwrt-linux-musl` | ✓ | ✓ | OpenWRT Linux MUSL
264268
[`mips64-openwrt-linux-musl`](platform-support/mips64-openwrt-linux-musl.md) | ? | | MIPS64 for OpenWrt Linux MUSL
269+
`mipsel-openwrt-linux-musl` | ✓ | ✓ | OpenWRT Linux MUSL
265270
`mipsel-sony-psp` | * | | MIPS (LE) Sony PlayStation Portable (PSP)
266271
[`mipsel-sony-psx`](platform-support/mipsel-sony-psx.md) | * | | MIPS (LE) Sony PlayStation 1 (PSX)
267272
`mipsel-unknown-linux-uclibc` | ✓ | | MIPS (LE) Linux with uClibc
@@ -275,6 +280,7 @@ target | std | host | notes
275280
`powerpc-unknown-linux-musl` | ? | |
276281
`powerpc-unknown-netbsd` | ✓ | ✓ |
277282
`powerpc-unknown-openbsd` | ? | |
283+
`powerpc64-openwrt-linux-musl` | ✓ | ✓ | OpenWRT Linux MUSL
278284
`powerpc-wrs-vxworks-spe` | ? | |
279285
`powerpc-wrs-vxworks` | ? | |
280286
`powerpc64-unknown-freebsd` | ✓ | ✓ | PPC64 FreeBSD (ELFv1 and ELFv2)
@@ -306,6 +312,7 @@ target | std | host | notes
306312
`x86_64-apple-ios-macabi` | ✓ | | Apple Catalyst on x86_64
307313
`x86_64-apple-tvos` | * | | x86 64-bit tvOS
308314
[`x86_64-apple-watchos-sim`](platform-support/apple-watchos.md) | ✓ | | x86 64-bit Apple WatchOS simulator
315+
`x86_64-openwrt-linux-musl` | ✓ | ✓ | OpenWRT Linux MUSL
309316
[`x86_64-pc-nto-qnx710`](platform-support/nto-qnx.md) | ? | | x86 64-bit QNX Neutrino 7.1 RTOS |
310317
[`x86_64-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | ✓ |
311318
`x86_64-pc-windows-msvc` | * | | 64-bit Windows XP support

0 commit comments

Comments
 (0)