From 9f160d09877b6203da7a04528b014469441e1bd9 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 12 Aug 2026 19:20:31 -0400 Subject: [PATCH] lib.systems: build Cygwin with the split GCC package set Cygwin is the first platform to select `useGccNG`, and it is the natural one: its libc is partly C++, so building `newlib-cygwin` needs C++ headers before any libc exists. The monolithic compiler handles that with a Cygwin-specific `langCC = stdenv.targetPlatform.isCygwin`; the split set has a stage that provides them, `libstdcxx-no-libc`, which the preceding commits add and wire in. Derived from the platform rather than set on the example spec, so it holds for any Cygwin triple, alongside the `useLLVM` rule it sits under. The comment saying no platform selects it is retired here, since that is what this changes. This changes what `pkgsCross.x86_64-cygwin` builds with for everyone, not only for callers passing the flag. Verified by building `gccNGPackages.{libgcc,libstdcxx,libstdcxx-no-libc}` and `stdenv.cc` with no `useGccNG` in the invocation; the derivations come out identical to those built with the flag passed explicitly. Assisted-by: Claude Code (Claude Opus 5) --- lib/systems/default.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 77e7a8f99ef4..2bd3f8927277 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -161,14 +161,12 @@ let (with final; isWindows && isAarch64); # Use the split GCC package set (`gccNGPackages`) instead of the - # monolithic `gcc`. No platform selects it yet; it is opt-in, set - # explicitly on a platform spec, so that the split set can be exercised - # before anything depends on it. + # monolithic `gcc`. # - # I (@Ericson2314) plan on making obscure low-tier platforms (e.g. - # NetBSD) use it soon, so we can dogfood GCC NG and thereby iron out its - # bugs. - useGccNG = false; + # I (@Ericson2314) plan on making more obscure low-tier + # platforms (e.g. NetBSD) use it soon, so we can dogfood GCC NG + # and thereby iron out its bugs. + useGccNG = final.isCygwin; libc = if final.isDarwin then