!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

535 Members
116 Servers

Load older messages


SenderMessageTime
15 Sep 2025
@matthewcroughan:defenestrate.itmatthewcroughan nix build nixpkgs#pkgsLLVM.pkgsMusl.netbsd.compat -L works though 🤨 19:08:56
@rosscomputerguy:matrix.orgTristan Ross Do a nix-diff between the two drv files of pkgsLLVM.pkgsMusl.netbsd.compat as the base and what you're trying to build as the other. 19:24:18
@rosscomputerguy:matrix.orgTristan RossIf you've configured cross correctly, they'll be the same.19:24:32
@matthewcroughan:defenestrate.itmatthewcroughanIs there no easy way to configure cross identically to `pkgsMusl?19:25:39
@matthewcroughan:defenestrate.itmatthewcroughan * 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 LIke I can't do nixpkgs.hostPlatform = pkgsMusl.hostPlatform because that's infinite recursion 19:26:17
@matthewcroughan:defenestrate.itmatthewcroughanbut 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 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.itmatthewcroughansince 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.itmatthewcroughanso for pkgsMusl, the buildPlatform is gnu?19:27:58
@matthewcroughan:defenestrate.itmatthewcroughanand 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 Ah yes, I get the ld errors when I set buildPlatform to aarch64-unknown-linux-musl 19:28:51
@matthewcroughan:defenestrate.itmatthewcroughan
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.itmatthewcroughanso 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.itmatthewcroughanYeah I've successfully build a minimal native musl system, I'm now going for gold with LLVM19:30:00
@matthewcroughan:defenestrate.itmatthewcroughan* 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

Show newer messages


Back to Room ListRoom Version: 6