2025-02-17 12:28:15 +01:00
|
|
|
# Nix-compiled binaries for xrsh.iso
|
|
|
|
|
|
|
|
Crosscompiling used to be tricky, due to dependencies.
|
|
|
|
With Nix this belongs to the past.
|
|
|
|
|
|
|
|
# building hello.c
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ nix-shell --run '$CC hello.c -o hello' hello.nix
|
|
|
|
$ file hello
|
|
|
|
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped
|
|
|
|
```
|
|
|
|
|
|
|
|
# building a nixos pkg
|
|
|
|
|
|
|
|
```bash
|
2025-02-18 16:09:27 +01:00
|
|
|
$ nix-build '<nixpkgs>' --pure -I nixpkgs=channel:nixos-24.05 -A pkgsCross.musl32.pkgsStatic.hello
|
2025-02-17 12:28:15 +01:00
|
|
|
$ file hello
|
|
|
|
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped
|
|
|
|
```
|
|
|
|
|
|
|
|
use the build-shellscripts in this directory as a startingpoint for your xrsh binaries.
|
|
|
|
|