Skip to content

Commit 0a1e42e

Browse files
committed
platform-support.md: document the various NetBSD targets.
This is slightly patterned after what OpenBSD has done. This is a step along the path to reduce the number and amount of diffs that pkgsrc carries around for rust, and this documents also some parts which have not yet been upstreamed (mipsel-*).
1 parent 6ef377c commit 0a1e42e

File tree

2 files changed

+117
-6
lines changed

2 files changed

+117
-6
lines changed

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

+9-6
Original file line numberDiff line numberDiff line change
@@ -223,29 +223,30 @@ target | std | host | notes
223223
`aarch64-unknown-freebsd` | ✓ | ✓ | ARM64 FreeBSD
224224
`aarch64-unknown-hermit` | ✓ | | ARM64 HermitCore
225225
`aarch64-unknown-linux-gnu_ilp32` | ✓ | ✓ | ARM64 Linux (ILP32 ABI)
226-
`aarch64-unknown-netbsd` | ✓ | ✓ |
226+
[`aarch64-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | ARM64 NetBSD
227227
[`aarch64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | ARM64 OpenBSD
228228
`aarch64-unknown-redox` | ? | | ARM64 Redox OS
229229
`aarch64-uwp-windows-msvc` | ? | |
230230
`aarch64-wrs-vxworks` | ? | |
231231
`aarch64_be-unknown-linux-gnu_ilp32` | ✓ | ✓ | ARM64 Linux (big-endian, ILP32 ABI)
232232
`aarch64_be-unknown-linux-gnu` | ✓ | ✓ | ARM64 Linux (big-endian)
233+
[`aarch64_be-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | ARM64 NetBSD (big-endian)
233234
[`arm64_32-apple-watchos`](platform-support/apple-watchos.md) | ✓ | | ARM Apple WatchOS 64-bit with 32-bit pointers
234235
[`armeb-unknown-linux-gnueabi`](platform-support/armeb-unknown-linux-gnueabi.md) | ✓ | ? | ARM BE8 the default ARM big-endian architecture since [ARMv6](https://developer.arm.com/documentation/101754/0616/armlink-Reference/armlink-Command-line-Options/--be8?lang=en).
235236
`armv4t-none-eabi` | * | | ARMv4T A32
236237
`armv4t-unknown-linux-gnueabi` | ? | |
237238
[`armv5te-none-eabi`](platform-support/armv5te-none-eabi.md) | * | | ARMv5TE A32
238239
`armv5te-unknown-linux-uclibceabi` | ? | | ARMv5TE Linux with uClibc
239240
`armv6-unknown-freebsd` | ✓ | ✓ | ARMv6 FreeBSD
240-
`armv6-unknown-netbsd-eabihf` | ? | |
241+
[`armv6-unknown-netbsd-eabihf`](platform-support/netbsd.md) | | ✓ | ARMv6 NetBSD w/hard-float
241242
[`armv6k-nintendo-3ds`](platform-support/armv6k-nintendo-3ds.md) | ? | | ARMv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain)
242243
`armv7-apple-ios` | ✓ | | ARMv7 iOS, Cortex-a8
243244
[`armv7-sony-vita-newlibeabihf`](platform-support/armv7-sony-vita-newlibeabihf.md) | ? | | ARM Cortex-A9 Sony PlayStation Vita (requires VITASDK toolchain)
244245
[`armv7-unknown-linux-ohos`](platform-support/openharmony.md) | ✓ | | ARMv7 OpenHarmony |
245246
[`armv7-unknown-linux-uclibceabi`](platform-support/armv7-unknown-linux-uclibceabi.md) | ✓ | ✓ | ARMv7 Linux with uClibc, softfloat
246247
[`armv7-unknown-linux-uclibceabihf`](platform-support/armv7-unknown-linux-uclibceabihf.md) | ✓ | ? | ARMv7 Linux with uClibc, hardfloat
247248
`armv7-unknown-freebsd` | ✓ | ✓ | ARMv7 FreeBSD
248-
`armv7-unknown-netbsd-eabihf` | ✓ | ✓ |
249+
[`armv7-unknown-netbsd-eabihf`](platform-support/netbsd.md) | ✓ | ✓ | ARMv7 NetBSD w/hard-float
249250
`armv7-wrs-vxworks-eabihf` | ? | |
250251
[`armv7a-kmc-solid_asp3-eabi`](platform-support/kmc-solid.md) | ✓ | | ARM SOLID with TOPPERS/ASP3
251252
[`armv7a-kmc-solid_asp3-eabihf`](platform-support/kmc-solid.md) | ✓ | | ARM SOLID with TOPPERS/ASP3, hardfloat
@@ -258,10 +259,11 @@ target | std | host | notes
258259
`hexagon-unknown-linux-musl` | ? | |
259260
`i386-apple-ios` | ✓ | | 32-bit x86 iOS
260261
[`i586-pc-nto-qnx700`](platform-support/nto-qnx.md) | * | | 32-bit x86 QNX Neutrino 7.0 RTOS |
262+
[`i586-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | NetBSD/i386 restricted to Pentium insns
261263
`i686-apple-darwin` | ✓ | ✓ | 32-bit macOS (10.7+, Lion+)
262264
`i686-pc-windows-msvc` | * | | 32-bit Windows XP support
263265
`i686-unknown-haiku` | ✓ | ✓ | 32-bit Haiku
264-
`i686-unknown-netbsd` | ✓ | ✓ | NetBSD/i386 with SSE2
266+
[`i686-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | NetBSD/i386 with SSE2
265267
[`i686-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | 32-bit OpenBSD
266268
`i686-uwp-windows-gnu` | ? | |
267269
`i686-uwp-windows-msvc` | ? | |
@@ -273,6 +275,7 @@ target | std | host | notes
273275
`mipsel-sony-psp` | * | | MIPS (LE) Sony PlayStation Portable (PSP)
274276
[`mipsel-sony-psx`](platform-support/mipsel-sony-psx.md) | * | | MIPS (LE) Sony PlayStation 1 (PSX)
275277
`mipsel-unknown-linux-uclibc` | ✓ | | MIPS (LE) Linux with uClibc
278+
[`mipsel-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | MIPS (LE) on NetBSD, requires mips32 CPU
276279
`mipsel-unknown-none` | * | | Bare MIPS (LE) softfloat
277280
`mipsisa32r6-unknown-linux-gnu` | ? | |
278281
`mipsisa32r6el-unknown-linux-gnu` | ? | |
@@ -281,7 +284,7 @@ target | std | host | notes
281284
`msp430-none-elf` | * | | 16-bit MSP430 microcontrollers
282285
`powerpc-unknown-linux-gnuspe` | ✓ | | PowerPC SPE Linux
283286
`powerpc-unknown-linux-musl` | ? | |
284-
`powerpc-unknown-netbsd` | ✓ | ✓ |
287+
[`powerpc-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | NetBSD 32-bit powerpc systems
285288
`powerpc-unknown-openbsd` | ? | |
286289
`powerpc-wrs-vxworks-spe` | ? | |
287290
`powerpc-wrs-vxworks` | ? | |
@@ -304,7 +307,7 @@ target | std | host | notes
304307
[`riscv64gc-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | OpenBSD/riscv64
305308
`s390x-unknown-linux-musl` | | | S390x Linux (kernel 3.2, MUSL)
306309
`sparc-unknown-linux-gnu` | ✓ | | 32-bit SPARC Linux
307-
`sparc64-unknown-netbsd` | ✓ | ✓ | NetBSD/sparc64
310+
[`sparc64-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | NetBSD/sparc64
308311
[`sparc64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | OpenBSD/sparc64
309312
`thumbv4t-none-eabi` | * | | ARMv4T T32
310313
[`thumbv5te-none-eabi`](platform-support/armv5te-none-eabi.md) | * | | ARMv5TE T32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# \*-unknown-netbsd
2+
3+
**Tier: 3**
4+
5+
[NetBSD] multi-platform 4.4BSD-based UNIX-like operating system.
6+
7+
[NetBSD]: https://www.NetBSD.org/
8+
9+
The target names follow this format: `$ARCH-unknown-netbsd{-$SUFFIX}`,
10+
where `$ARCH` specifies the target processor architecture and
11+
`-$SUFFIX` (optional) might indicate the ABI. The following targets
12+
are currently defined running NetBSD:
13+
14+
| Target name | NetBSD Platform |
15+
|--------------------------------|-----------------|
16+
| `amd64-unknown-netbsd` | [amd64 / x86_64 systems](https://wiki.netbsd.org/ports/amd64/) |
17+
| `armv7-unknown-netbsd-eabihf` | [32-bit ARMv7 systems with hard-float](https://wiki.netbsd.org/ports/evbarm/) |
18+
| `armv6-unknown-netbsd-eabihf` | [32-bit ARMv6 systems with hard-float](https://wiki.netbsd.org/ports/evbarm/) |
19+
| `aarch64-unknown-netbsd` | [64-bit ARM systems, little-endian](https://wiki.netbsd.org/ports/evbarm/) |
20+
| `aarch64_be-unknown-netbsd` | [64-bit ARM systems, big-endian](https://wiki.netbsd.org/ports/evbarm/) |
21+
| `i586-unknown-netbsd` | [32-bit i386, restricted to Pentium](https://wiki.netbsd.org/ports/i386/) |
22+
| `i686-unknown-netbsd` | [32-bit i386 with SSE](https://wiki.netbsd.org/ports/i386/) |
23+
| `mipsel-unknown-netbsd` | [32-bit mips, requires mips32 cpu support](https://wiki.netbsd.org/ports/evbmips/) |
24+
| `powerpc-unknown-netbsd` | [Various 32-bit PowerPC systems, e.g. MacPPC](https://wiki.netbsd.org/ports/macppc/) |
25+
| `sparc64-unknown-netbsd` | [Sun UltraSPARC systems](https://wiki.netbsd.org/ports/sparc64/) |
26+
27+
All use the "native" `stdc++` library which goes along with the natively
28+
supplied GNU C++ compiler for the given OS version. Many of the bootstraps
29+
are built for NetBSD 9.x, although some exceptions exist (some
30+
are built for NetBSD 8.x but also work on newer OS versions).
31+
32+
33+
## Designated Developers
34+
35+
- [@he32](https://github.com/he32), `[email protected]`
36+
- [NetBSD/pkgsrc-wip's rust](https://github.com/NetBSD/pkgsrc-wip/blob/master/rust/Makefile) maintainer (see MAINTAINER variable). This package is part of "pkgsrc work-in-progress" and is used for deployment and testing of new versions of rust
37+
- [NetBSD's pkgsrc lang/rust](https://github.com/NetBSD/pkgsrc/tree/trunk/lang/rust) for the "proper" package in pkgsrc.
38+
- [NetBSD's pkgsrc lang/rust-bin](https://github.com/NetBSD/pkgsrc/tree/trunk/lang/rust-bin) which re-uses the bootstrap kit as a binary distribution and therefore avoids the rather protracted native build time of rust itself
39+
40+
Fallback to [email protected], or fault reporting via NetBSD's
41+
bug reporting system.
42+
43+
## Requirements
44+
45+
The `amd64-unknown-netbsd` artifacts is being distributed by the
46+
rust project.
47+
48+
The other targets are built by the designated developers (see above),
49+
and the targets are initially cross-compiled, but many if not most
50+
of them are also built natively as part of testing.
51+
52+
53+
## Building
54+
55+
The default build mode for the packages is a native build.
56+
57+
58+
## Cross-compilation
59+
60+
These targets can be cross-compiled, and we do that via the pkgsrc
61+
package(s).
62+
63+
Cross-compilation typically requires the "tools" and "dest" trees
64+
resulting from a normal cross-build of NetBSD itself, ref. our main
65+
build script, `build.sh`.
66+
67+
See e.g. [do-cross.mk
68+
Makefile](https://github.com/NetBSD/pkgsrc/tree/trunk/lang/rust/do-cross.mk)
69+
for the Makefile used to cross-build all the above NetBSD targets
70+
(except for the `amd64` target).
71+
72+
The major option for the rust build is whether to build rust with
73+
the LLVM rust carries in its distribution, or use the LLVM package
74+
installed from pkgsrc. The `PKG_OPTIONS.rust` option is
75+
`rust-internal-llvm`, ref. [the rust package's options.mk make
76+
fragment](https://github.com/NetBSD/pkgsrc/blob/trunk/lang/rust/options.mk).
77+
It defaults to being set for a few of the above platforms, for
78+
various reasons (see comments), but is otherwise unset and therefore
79+
indicates use of the pkgsrc LLVM.
80+
81+
82+
## Testing
83+
84+
The Rust testsuite could presumably be run natively.
85+
86+
For the systems where the maintainer can build natively, the rust
87+
compiler itself is re-built natively. This involves the rust compiler
88+
being re-built with the newly self-built rust compiler, so excercises
89+
the result quite extensively.
90+
91+
Additionally, for some systems we build `librsvg`, and for the more
92+
capable systems we build and test `firefox` (amd64, i386, aarch64).
93+
94+
95+
## Building Rust programs
96+
97+
Rust ships pre-compiled artifacts for the `amd64-unknown-netbsd`
98+
target.
99+
100+
For the other systems mentioned above, using the `pkgsrc` route is
101+
probably the easiest, possibly via the `rust-bin` package to save
102+
time, see the `RUST_TYPE` variable from the `rust.mk` Makefile
103+
fragment.
104+
105+
The pkgsrc rust package has a few files to assist with building
106+
pkgsrc packages written in rust, ref. the `rust.mk` and `cargo.mk`
107+
Makefile fragments in the `lang/rust` package.
108+

0 commit comments

Comments
 (0)