| 15 Sep 2025 |
Tristan Ross | Your localSystem needs to be the standard GNU triple | 19:26:13 |
matthewcroughan | LIke I can't do nixpkgs.hostPlatform = pkgsMusl.hostPlatform because that's infinite recursion | 19:26:17 |
matthewcroughan | but it's what I want to | 19:26:19 |
Tristan Ross | Take a look at pkgs/top-level/variants.nix or pkgs/top-level/stage.nix to see what pkgsMusl does | 19:26:49 |
matthewcroughan | I don't want the GNU triple, I want the same evaluation and code as in pkgs/top-level/variants.nix | 19:27:01 |
matthewcroughan | since it's always correctly configured there, it should be exposed | 19:27:12 |
Tristan Ross | You have to use the GNU triple for the buildPlatform | 19:27:16 |
Tristan Ross | For hostPlatform, just use the musl one | 19:27:28 |
matthewcroughan | so for pkgsMusl, the buildPlatform is gnu? | 19:27:58 |
matthewcroughan | and that's just some default of nixpkgs? | 19:28:02 |
Tristan Ross | Yes | 19:28:07 |
emily | if it's cross then buildPlatform is your main platform by definition | 19:28:36 |
emily | Musl has fully-bootstrapped stdenv so you can do non-cross | 19:28:43 |
matthewcroughan | Ah yes, I get the ld errors when I set buildPlatform to aarch64-unknown-linux-musl | 19:28:51 |
matthewcroughan | j/src/unistd/ttyname_r.lo obj/src/unistd/ualarm.lo obj/src/unistd/unlink.lo obj/src/unistd/unlinkat.lo obj/src/unistd/usleep.lo obj/src/unistd/write.lo obj/src/unistd/writev.lo obj/ldso/dlstart.lo obj/ldso/dynlink.lo
> aarch64-unknown-linux-musl-ranlib lib/libc.a
> collect2: fatal error: cannot find 'ld'
> compilation terminated.
> make: *** [Makefile:162: lib/libc.so] Error 1
> make: *** Waiting for unfinished jobs..
| 19:29:08 |
matthewcroughan | so now I'm using gnu I'll report back | 19:29:19 |
Tristan Ross | Matt is trying to mix it with LLVM which I don't think musl host into an LLVM cross is something which has been tested before. | 19:29:37 |
emily | ah | 19:29:59 |
matthewcroughan | Yeah I've successfully build a minimal native musl system, I'm now going for gold with LLVM | 19:30:00 |
matthewcroughan | * Yeah I've successfully built a minimal native musl system, I'm now going for gold with LLVM | 19:30:08 |
Tristan Ross | I've done pkgsMusl.pkgsLLVM but that's different | 19:30:17 |
emily | there's no bootstrapped LLVM Linux stdenv, yeah | 19:30:24 |
Tristan Ross | Yeah, it has errors if you try | 19:30:41 |
Tristan Ross | But Matt is trying to do a GCC host with Musl to an LLVM target with Musl | 19:31:06 |
Tristan Ross | Which seems to somewhat be possible but isn't exactly tested | 19:31:27 |
Tristan Ross | I've been wanting to do an LLVM bootstrap but there's been blockers, like cleaning up the versions. | 19:32:34 |
Tristan Ross | And redoing the default.nix to not split tools and libraries is something that's better as well. | 19:33:16 |
matthewcroughan | Tristan Ross: Is this misconfigured? Because it's still producing errors
nixpkgs.buildPlatform = "aarch64-unknown-linux-gnu";
nixpkgs.hostPlatform = lib.recursiveUpdate (lib.systems.elaborate "aarch64-linux") {
useLLVM = true;
linker = "lld";
linux-kernel.target = "vmlinuz.efi";
linux-kernel.installTarget = "zinstall";
config = "aarch64-unknown-linux-musl";
};
| 19:39:49 |
matthewcroughan | I will get you the diff shortly | 19:40:13 |
Tristan Ross | That should be fine | 19:40:18 |