about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-01-05 07:01:38 +0000
committerbors <bors@rust-lang.org>2025-01-05 07:01:38 +0000
commit7270e73b622d60e770936ace5271a068fa32785b (patch)
tree5eaf056253b097a16aeb204d435b310a09e3ca3f /src
parent8417f8311fcb596030768a817e1e4eacb214b78e (diff)
parent1a8228707040a0bd718991fbbeda8a428fbb8938 (diff)
Auto merge of #135074 - wzssyqa:mips-mti, r=oli-obk
Target: Add mips mti baremetal support

Do the same thing as gcc, which use the vendor `mti` to mark the toolchain as MIPS32r2 default.

We support both big endian and little endian flavor:
  mips-mti-none-elf
  mipsel-mti-none-elf
Diffstat (limited to 'src')
-rw-r--r--src/doc/rustc/src/SUMMARY.md1
-rw-r--r--src/doc/rustc/src/platform-support.md2
-rw-r--r--src/doc/rustc/src/platform-support/mips-mti-none-elf.md31
-rw-r--r--src/tools/build-manifest/src/main.rs2
4 files changed, 36 insertions, 0 deletions
diff --git a/src/doc/rustc/src/SUMMARY.md b/src/doc/rustc/src/SUMMARY.md
index 0f45c9dbd4e..01fabfb39a7 100644
--- a/src/doc/rustc/src/SUMMARY.md
+++ b/src/doc/rustc/src/SUMMARY.md
@@ -62,6 +62,7 @@
     - [m68k-unknown-linux-gnu](platform-support/m68k-unknown-linux-gnu.md)
     - [mips64-openwrt-linux-musl](platform-support/mips64-openwrt-linux-musl.md)
     - [mipsel-sony-psx](platform-support/mipsel-sony-psx.md)
+    - [mips\*-mti-none-elf](platform-support/mips-mti-none-elf.md)
     - [mipsisa\*r6\*-unknown-linux-gnu\*](platform-support/mips-release-6.md)
     - [nvptx64-nvidia-cuda](platform-support/nvptx64-nvidia-cuda.md)
     - [powerpc-unknown-openbsd](platform-support/powerpc-unknown-openbsd.md)
diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md
index 7b07d991992..1d202402288 100644
--- a/src/doc/rustc/src/platform-support.md
+++ b/src/doc/rustc/src/platform-support.md
@@ -332,6 +332,8 @@ target | std | host | notes
 `mipsel-unknown-linux-uclibc` | ✓ |  | MIPS (LE) Linux with uClibc
 [`mipsel-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | 32-bit MIPS (LE), requires mips32 cpu support
 `mipsel-unknown-none` | * |  | Bare MIPS (LE) softfloat
+[`mips-mti-none-elf`](platform-support/mips-mti-none-elf.md) | * |  | Bare MIPS32r2 (BE) softfloat
+[`mipsel-mti-none-elf`](platform-support/mips-mti-none-elf.md) | * |  | Bare MIPS32r2 (LE) softfloat
 [`mipsisa32r6-unknown-linux-gnu`](platform-support/mips-release-6.md) | ? |  | 32-bit MIPS Release 6 Big Endian
 [`mipsisa32r6el-unknown-linux-gnu`](platform-support/mips-release-6.md) | ? |  | 32-bit MIPS Release 6 Little Endian
 [`mipsisa64r6-unknown-linux-gnuabi64`](platform-support/mips-release-6.md) | ? |  | 64-bit MIPS Release 6 Big Endian
diff --git a/src/doc/rustc/src/platform-support/mips-mti-none-elf.md b/src/doc/rustc/src/platform-support/mips-mti-none-elf.md
new file mode 100644
index 00000000000..731f0a8c42f
--- /dev/null
+++ b/src/doc/rustc/src/platform-support/mips-mti-none-elf.md
@@ -0,0 +1,31 @@
+# `mips*-mti-none-elf`
+
+**Tier: 3**
+
+MIPS32r2 baremetal softfloat, Big Endian or Little Endian.
+
+- mips-mti-none-elf
+- mipsel-mti-none-elf
+
+## Target maintainers
+
+- YunQiang Su, `syq@debian.org`, https://github.com/wzssyqa
+
+## Background
+
+These 2 targets, aka mips-mti-none-elf and mipsel-mti-none-elf, are for
+baremetal development of MIPS32r2. The lld is used instead of Gnu-ld.
+
+## Requirements
+
+The target only supports cross compilation and no host tools. The target
+supports `alloc` with a default allocator while only support `no-std` development.
+
+The vendor name `mti` follows the naming of gcc to indicate MIPS32r2.
+
+## Cross-compilation toolchains and C code
+
+Compatible C code can be built for this target on any compiler that has a MIPS32r2
+target.  On clang and ld.lld linker, it can be generated using the
+`-march=mips`/`-march=mipsel`, `-mabi=32` with llvm features flag
+`features=+mips32r2,+soft-float,+noabicalls`.
diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs
index 561b611148a..d6ca03f7643 100644
--- a/src/tools/build-manifest/src/main.rs
+++ b/src/tools/build-manifest/src/main.rs
@@ -128,6 +128,8 @@ static TARGETS: &[&str] = &[
     "mipsisa64r6el-unknown-linux-gnuabi64",
     "mipsel-unknown-linux-gnu",
     "mipsel-unknown-linux-musl",
+    "mips-mti-none-elf",
+    "mipsel-mti-none-elf",
     "nvptx64-nvidia-cuda",
     "powerpc-unknown-linux-gnu",
     "powerpc64-unknown-linux-gnu",