Skip to content

Commit a44405e

Browse files
committed
docs: update cross compilation section from autotools to meson
fixes #12934
1 parent 50ab1e3 commit a44405e

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

doc/manual/source/development/building.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -195,29 +195,24 @@ Nix uses a string with the following format to identify the *system type* or *pl
195195
<cpu>-<os>[-<abi>]
196196
```
197197

198-
It is set when Nix is compiled for the given system, and based on the output of [`config.guess`](https://github.com/nixos/nix/blob/master/config/config.guess) ([upstream](https://git.savannah.gnu.org/cgit/config.git/tree/config.guess)):
198+
It is set when Nix is compiled for the given system, and based on the output of meson's [host_machine information](https://mesonbuild.com/Reference-manual_builtin_host_machine.html)>
199199

200200
```
201201
<cpu>-<vendor>-<os>[<version>][-<abi>]
202202
```
203203

204-
When Nix is built such that `./configure` is passed any of the `--host`, `--build`, `--target` options, the value is based on the output of [`config.sub`](https://github.com/nixos/nix/blob/master/config/config.sub) ([upstream](https://git.savannah.gnu.org/cgit/config.git/tree/config.sub)):
204+
When cross-compiling Nix with Meson for local development, you need to specify a [cross-file](https://mesonbuild.com/Cross-compilation.html) using the `--cross-file` option. Cross-files define the target architecture and toolchain. When cross-compiling Nix with Nix, Nixpkgs takes care of this for you.
205+
206+
In the nix flake we also have some cross-compilation targets available:
205207

206208
```
207-
<cpu>-<vendor>[-<kernel>]-<os>
209+
nix build .#nix-everything-riscv64-unknown-linux-gnu
210+
nix build .#nix-everything-armv7l-unknown-linux-gnueabihf
211+
nix build .#nix-everything-armv7l-unknown-linux-gnueabihf
212+
nix build .#nix-everything-x86_64-unknown-freebsd
213+
nix build .#nix-everything-x86_64-w64-mingw32
208214
```
209215

210-
For historic reasons and backward-compatibility, some CPU and OS identifiers are translated from the GNU Autotools naming convention in [`configure.ac`](https://github.com/nixos/nix/blob/master/configure.ac) as follows:
211-
212-
| `config.guess` | Nix |
213-
|----------------------------|---------------------|
214-
| `amd64` | `x86_64` |
215-
| `i*86` | `i686` |
216-
| `arm6` | `arm6l` |
217-
| `arm7` | `arm7l` |
218-
| `linux-gnu*` | `linux` |
219-
| `linux-musl*` | `linux` |
220-
221216
## Compilation environments
222217

223218
Nix can be compiled using multiple environments:

0 commit comments

Comments
 (0)