Skip to content

Commit

Permalink
doc: Add *-unknown-managarm-mlibc documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
no92 committed Apr 1, 2024
1 parent 708bb1e commit 8b2f750
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/doc/rustc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
- [\*-nto-qnx-\*](platform-support/nto-qnx.md)
- [*-unikraft-linux-musl](platform-support/unikraft-linux-musl.md)
- [*-unknown-hermit](platform-support/hermit.md)
- [\*-unknown-managarm-mlibc](platform-support/managarm.md)
- [\*-unknown-netbsd\*](platform-support/netbsd.md)
- [*-unknown-openbsd](platform-support/openbsd.md)
- [\*-unknown-uefi](platform-support/unknown-uefi.md)
Expand Down
1 change: 1 addition & 0 deletions src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ target | std | host | notes
`x86_64-unknown-haiku` | ✓ | ✓ | 64-bit Haiku
[`x86_64-unknown-hermit`](platform-support/hermit.md) | ✓ | | x86_64 Hermit
`x86_64-unknown-l4re-uclibc` | ? | |
[`x86_64-unknown-managarm-mlibc`](platform-support/managarm.md) | | | x86_64 managarm
[`x86_64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 64-bit OpenBSD
`x86_64-uwp-windows-gnu` | ✓ | |
`x86_64-uwp-windows-msvc` | ✓ | |
Expand Down
63 changes: 63 additions & 0 deletions src/doc/rustc/src/platform-support/managarm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# `*-unknown-managarm-mlibc`

**Tier: 3**

## Target Maintainers

- [@no92](https://github.com/no92)
- [@64](https://github.com/64)
- [@Dennisbonke](https://github.com/Dennisbonke)

## Requirements

This target is cross-compiled. There is currently no support for `std` yet. It generates binaries in the ELF format.

## Building the target

For now, building a patched LLVM with [our patches located here](https://github.com/managarm/bootstrap-managarm/tree/master/patches/llvm) is necessary.

Once that is done, set up your `config.toml` like this:

```toml
change-id = 102579

[llvm]
targets = "X86"
download-ci-llvm = false

[build]
target = ["x86_64-unknown-managarm-mlibc", "x86_64-unknown-linux-gnu"]
build-dir = "/path/to/the/build/dir"
docs = false

[install]
prefix = "/path/to/the/prefix"
sysconfdir = "etc"

[rust]
codegen-tests = false
deny-warnings = false

[target.x86_64-unknown-linux-gnu]
llvm-config = "/path/to/your/llvm/bin/llvm-config"

[target.x86_64-unknown-managarm-mlibc]
llvm-config = "/path/to/your/llvm/bin/llvm-config"
```

## Building Rust programs

Build a `x86_64-managarm-gcc` using our [gcc fork](https://github.com/managarm/gcc).

```toml
[build]
rustc = "/path/to/the/rust-prefix/bin/rustc"
target = "x86_64-unknown-managarm-mlibc"

[target.x86_64-unknown-managarm-mlibc]
linker = "/path/to/the/managarm-gcc/bin/x86_64-managarm-gcc"
```

## Testing

This target does not support running the Rust testsuite yet.

0 comments on commit 8b2f750

Please sign in to comment.