| 25 Apr 2025 |
dramforever | we'll write (b, h, t) from now on | 05:24:30 |
dramforever | and you pass localSystem and crossSystem to nixpkgs, let's call those L and C | 05:24:47 |
dramforever | we build pkgs.gcc from that, what happens? | 05:26:45 |
dramforever | oh btw as i said t doesn't matter if you're not a compiler, so i'll write (b, h, *) in cases where t doesn't matter | 05:27:43 |
dramforever | firstly, the bootstrap process eventually makes a (L, L, L) gcc | 05:28:18 |
dramforever | using that we build a (L, L, C) gcc (without libc) | 05:29:25 |
dramforever | and using that, we build a (L, C, *) glibc | 05:29:55 |
dramforever | we combine the two together to make a (L, L, C) gcc wrapper (contains libc) | 05:30:15 |
outfoxxed | isn't the gcc and glibc build process supposed to be combined in some way nobody else does that makes this overly annoying | 05:32:00 |
outfoxxed | so does this mean a "build on L, runs/links on C" glibc? | 05:34:14 |
dramforever | correct | 05:34:53 |
outfoxxed | so what makes gcc single-target? just design choices on their end | 05:35:40 |
dramforever | yes | 05:35:48 |
outfoxxed | most other compilers are (L, L, *) right | 05:36:04 |
dramforever | unwrapped clang is (L, L, *) | 05:36:27 |
dramforever | which is why when you cross using llvm you don't rebuild the entire clang | 05:36:41 |
dramforever | but wrapped clang is (L, L, C) because it has the libc and stuff wrapped in it | 05:37:13 |
outfoxxed | ok that makes sense thanks | 05:37:28 |
dramforever | if we're actually trying to get pkgs.gcc, then we need to keep going because we want to have a gcc that runs on C | 05:42:40 |
dramforever | so using that (L, L, C) gcc we build a (L, C, C) gcc, and wrap that with the (L, C, *) glibc to create a (L, C, C) gcc wrapper | 05:43:04 |
dramforever | now this is as far as the whole process goes in nixpkgs | 05:43:23 |
outfoxxed | at this point we dont care about B, so just (*, C, C) right | 05:43:40 |
dramforever | everything in nixpkgs has the same b | 05:44:36 |
outfoxxed | ok that also makes sense | 05:45:08 |
outfoxxed | unless you override stdenv it wont go through QEMU or anything | 05:45:24 |
dramforever | so the way this works is
^ going up, buildPackages
l l l
l l c
l c c <- pkgs
v going down, targetPackages
| 05:46:56 |
dramforever | * so the way buildPackages and targetPackages works is
^ going up, buildPackages
l l l
l l c
l c c <- pkgs
v going down, targetPackages
| 05:47:10 |
outfoxxed | ok | 05:47:34 |
dramforever | so when you select packages from these,
l l l <- pkgs.buildPackages.buildPackages = pkgs.pkgsBuildBuild
l l c <- pkgs.buildPackages = pkgs.pkgsBuildHost
l c c <- pkgs = pkgs.pkgsHostTarget
| 05:49:23 |
outfoxxed | alright
thanks for the explanation | 05:50:09 |