diff options
author | Adam Joseph <adam@westernsemico.com> | 2023-06-27 19:18:50 -0700 |
---|---|---|
committer | Adam Joseph <adam@westernsemico.com> | 2023-06-27 19:21:49 -0700 |
commit | 0344bcbcf43eabcbcd20b8691eb5c139c79772ef (patch) | |
tree | 814b5ca43d62b9e86947c54a953d7ae3fe659713 /pkgs/development/compilers/gcc/10/default.nix | |
parent | 6f234b303de6b19a341231c8f62158c0d3749036 (diff) |
gcc: deduplicate boilerplate
This commit deduplicates libgcc-related boilerplate which appears in every version of our gcc expression, by moving it into libgcc.nix. I will be submitting a separate PR which changes this boilerplate, but that PR will be much easier to review if I can make the change in just one place. Meanwhile, *this* commit has no effect on eval: $ for A in 10 11 12 13 4.8 4.9 6 7 8 9; do nix-instantiate . -A gcc$(echo $A | tr -d .); done 2>/dev/null | sort | tee before /nix/store/1a37lnzpnz0dhm3lphiy2gcdrxgqa7ma-gcc-wrapper-4.8.5.drv /nix/store/5szdivc8il0c3g94dq4wqnq5j77a9h6p-gcc-wrapper-11.4.0.drv /nix/store/bmmc717wmnp1j2xkd3if5dfxicnflvn5-gcc-wrapper-7.5.0.drv /nix/store/fc1ggpixv3wqcazchhl2hnn5zl5ds30l-gcc-wrapper-13.1.0.drv /nix/store/j9c2b20w35r3ag5nxmklhagbwsgjhds2-gcc-wrapper-4.9.4.drv /nix/store/nq7q57bxmsk2g457wr4b9449as3f216w-gcc-wrapper-12.3.0.drv /nix/store/sqmkkfapzykapcs4azvxm83n786ga7q1-gcc-wrapper-10.4.0.drv /nix/store/vxnz30i23mkl4ldsq485kxn7q0p2y4nf-gcc-wrapper-8.5.0.drv /nix/store/yfhv0bv15cg5kj2xsb9fcgb6pdlw42v0-gcc-wrapper-6.5.0.drv /nix/store/yi5gr75pb6kddnll10jg25hhndhkba7s-gcc-wrapper-9.5.0.drv $ for A in 10 11 12 13 4.8 4.9 6 7 8 9; do nix-instantiate . -A gcc$(echo $A | tr -d .); done | sort | tee after /nix/store/1a37lnzpnz0dhm3lphiy2gcdrxgqa7ma-gcc-wrapper-4.8.5.drv /nix/store/5szdivc8il0c3g94dq4wqnq5j77a9h6p-gcc-wrapper-11.4.0.drv /nix/store/bmmc717wmnp1j2xkd3if5dfxicnflvn5-gcc-wrapper-7.5.0.drv /nix/store/fc1ggpixv3wqcazchhl2hnn5zl5ds30l-gcc-wrapper-13.1.0.drv /nix/store/j9c2b20w35r3ag5nxmklhagbwsgjhds2-gcc-wrapper-4.9.4.drv /nix/store/nq7q57bxmsk2g457wr4b9449as3f216w-gcc-wrapper-12.3.0.drv /nix/store/sqmkkfapzykapcs4azvxm83n786ga7q1-gcc-wrapper-10.4.0.drv /nix/store/vxnz30i23mkl4ldsq485kxn7q0p2y4nf-gcc-wrapper-8.5.0.drv /nix/store/yfhv0bv15cg5kj2xsb9fcgb6pdlw42v0-gcc-wrapper-6.5.0.drv /nix/store/yi5gr75pb6kddnll10jg25hhndhkba7s-gcc-wrapper-9.5.0.drv $ diff -u after before $
Diffstat (limited to 'pkgs/development/compilers/gcc/10/default.nix')
-rw-r--r-- | pkgs/development/compilers/gcc/10/default.nix | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index eef6ebc68331c..c1f6f061f8cd1 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -27,6 +27,7 @@ , cloog ? null # unused; just for compat with gcc4, as we override the parameter on some places , buildPackages , libxcrypt +, callPackage }: # Make sure we get GNU sed. @@ -143,7 +144,7 @@ let majorVersion = "10"; in -stdenv.mkDerivation ({ +lib.pipe (stdenv.mkDerivation ({ pname = "${crossNameAddon}${name}"; inherit version; @@ -291,10 +292,8 @@ stdenv.mkDerivation ({ } -// optionalAttrs (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt" && crossStageStatic) { - makeFlags = [ "all-gcc" "all-target-libgcc" ]; - installTargets = "install-gcc install-target-libgcc"; -} - // optionalAttrs (enableMultilib) { dontMoveLib64 = true; } -) +)) +[ + (callPackage ../common/libgcc.nix { inherit version langC langCC langJit targetPlatform hostPlatform crossStageStatic; }) +] |