@@ -6996,42 +6996,46 @@ with pkgs;
69966996
69976997 wla-dx = callPackage ../development/compilers/wla-dx { };
69986998
6999− wrapCCWith = { name ? "", cc, bintools, libc, extraBuildCommands ? "" }:
7000− ccWrapperFun rec {
6999+ wrapCCWith =
7000+ { cc
7001+ , # This should be the only bintools runtime dep with this sort of logic. The
7002+ # Others should instead delegate to the next stage's choice with
7003+ # `targetPackages.stdenv.cc.bintools`. This one is different just to
7004+ # provide the default choice, avoiding infinite recursion.
7005+ bintools ? if targetPlatform.isDarwin then darwin.binutils else binutils
7006+ , libc ? bintools.libc
7007+ , ...
7008+ } @ extraArgs:
7009+ callPackage ../build-support/cc-wrapper (let self = {
70017010 nativeTools = targetPlatform == hostPlatform && stdenv.cc.nativeTools or false;
70027011 nativeLibc = targetPlatform == hostPlatform && stdenv.cc.nativeLibc or false;
70037012 nativePrefix = stdenv.cc.nativePrefix or "";
7004− noLibc = !nativeLibc && (libc == null);
7013+ noLibc = !self.nativeLibc && (self.libc == null);
70057014
70067015 isGNU = cc.isGNU or false;
70077016 isClang = cc.isClang or false;
70087017
7009− inherit name cc bintools libc extraBuildCommands;
7010− };
7011−
7012− ccWrapperFun = callPackage ../build-support/cc-wrapper;
7013− bintoolsWrapperFun = callPackage ../build-support/bintools-wrapper;
7018+ inherit cc bintools libc;
7019+ } // extraArgs; in self);
70147020
70157021 wrapCC = cc: wrapCCWith {
7016− name = lib.optionalString (targetPlatform != hostPlatform) "gcc-cross-wrapper";
70177022 inherit cc;
7018− # This should be the only bintools runtime dep with this sort of logic. The
7019− # Others should instead delegate to the next stage's choice with
7020− # `targetPackages.stdenv.cc.bintools`. This one is different just to
7021− # provide the default choice, avoiding infinite recursion.
7022− bintools = if targetPlatform.isDarwin then darwin.binutils else binutils;
7023− libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc;
70247023 };
70257024
7026− wrapBintoolsWith = { bintools, libc, extraBuildCommands ? "" }: bintoolsWrapperFun {
7025+ wrapBintoolsWith =
7026+ { bintools
7027+ , libc ? if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc
7028+ , ...
7029+ } @ extraArgs:
7030+ callPackage ../build-support/bintools-wrapper (let self = {
70277031 nativeTools = targetPlatform == hostPlatform && stdenv.cc.nativeTools or false;
70287032 nativeLibc = targetPlatform == hostPlatform && stdenv.cc.nativeLibc or false;
70297033 nativePrefix = stdenv.cc.nativePrefix or "";
70307034
7031− noLibc = (libc == null);
7035+ noLibc = (self.libc == null);
70327036
7033− inherit bintools libc extraBuildCommands;
7034− };
7037+ inherit bintools libc;
7038+ } // extraArgs; in self);
70357039
70367040 # prolog
70377041 yap = callPackage ../development/compilers/yap { };
@@ -7637,11 +7641,9 @@ with pkgs;
76377641 noSysDirs = (targetPlatform != buildPlatform) || noSysDirs;
76387642 };
76397643 binutils = wrapBintoolsWith {
7640− libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc;
76417644 bintools = binutils-unwrapped;
76427645 };
76437646 binutils_nogold = lowPrio (wrapBintoolsWith {
7644− libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc;
76457647 bintools = binutils-unwrapped.override {
76467648 gold = false;
76477649 };