!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

570 Members
125 Servers

Load older messages


SenderMessageTime
15 Sep 2025
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192) * Is there no easy way to configure cross identically to pkgsMusl? 19:25:43
@rosscomputerguy:matrix.orgTristan RossThere is19:25:52
@rosscomputerguy:matrix.orgTristan Ross Your localSystem needs to be the standard GNU triple 19:26:13
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192) LIke I can't do nixpkgs.hostPlatform = pkgsMusl.hostPlatform because that's infinite recursion 19:26:17
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)but it's what I want to19:26:19
@rosscomputerguy:matrix.orgTristan 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:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192) 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:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)since it's always correctly configured there, it should be exposed19:27:12
@rosscomputerguy:matrix.orgTristan Ross You have to use the GNU triple for the buildPlatform 19:27:16
@rosscomputerguy:matrix.orgTristan Ross For hostPlatform, just use the musl one 19:27:28
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)so for pkgsMusl, the buildPlatform is gnu?19:27:58
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)and that's just some default of nixpkgs?19:28:02
@rosscomputerguy:matrix.orgTristan RossYes19:28:07
@emilazy:matrix.orgemily if it's cross then buildPlatform is your main platform by definition 19:28:36
@emilazy:matrix.orgemily Musl has fully-bootstrapped stdenv so you can do non-cross 19:28:43
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192) Ah yes, I get the ld errors when I set buildPlatform to aarch64-unknown-linux-musl 19:28:51
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)
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:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)so now I'm using gnu I'll report back19:29:19
@rosscomputerguy:matrix.orgTristan RossMatt 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
@emilazy:matrix.orgemilyah19:29:59
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)Yeah I've successfully build a minimal native musl system, I'm now going for gold with LLVM19:30:00
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)* Yeah I've successfully built a minimal native musl system, I'm now going for gold with LLVM19:30:08
@rosscomputerguy:matrix.orgTristan Ross I've done pkgsMusl.pkgsLLVM but that's different 19:30:17
@emilazy:matrix.orgemily there's no bootstrapped LLVM Linux stdenv, yeah 19:30:24
@rosscomputerguy:matrix.orgTristan RossYeah, it has errors if you try19:30:41
@rosscomputerguy:matrix.orgTristan RossBut Matt is trying to do a GCC host with Musl to an LLVM target with Musl19:31:06
@rosscomputerguy:matrix.orgTristan RossWhich seems to somewhat be possible but isn't exactly tested19:31:27
@rosscomputerguy:matrix.orgTristan RossI've been wanting to do an LLVM bootstrap but there's been blockers, like cleaning up the versions.19:32:34
@rosscomputerguy:matrix.orgTristan RossAnd redoing the default.nix to not split tools and libraries is something that's better as well.19:33:16
@matthewcroughan:defenestrate.itmatthewcroughan @ 39c3 (DECT 94667 or 97340 or 67192)

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

Show newer messages


Back to Room ListRoom Version: 6