|
| 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. |
0 commit comments