20 gnat-bootstrap ? null,
27 withoutTargetLibc ? null,
32 inherit (lib) optionals;
33 inherit (stdenv) buildPlatform hostPlatform targetPlatform;
38 depsBuildBuild = [ buildPackages.stdenv.cc ];
46 ++ optionals (perl != null) [ perl ]
47 ++ optionals (with stdenv.targetPlatform; isVc4 || isRedox && flex != null) [ flex ]
48 ++ optionals langAda [ gnat-bootstrap ]
49 ++ optionals langRust [ cargo ]
50 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
51 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
52 ++ optionals buildPlatform.isDarwin [ gnused ];
54 # For building runtime libs
58 if hostPlatform == buildPlatform then
60 targetPackages.stdenv.cc.bintools # newly-built gcc will be used
63 assert targetPlatform == hostPlatform;
65 # build != host == target
69 ++ optionals targetPlatform.isLinux [ patchelf ];
77 ++ optionals (lib.versionAtLeast version "10") [ libxcrypt ]
79 targetPackages.stdenv.cc.bintools # For linking code at run-time
81 ++ optionals (isl != null) [ isl ]
82 ++ optionals (zlib != null) [ zlib ]
83 ++ optionals (langGo && stdenv.hostPlatform.isMusl) [ libucontext ]
84 ++ optionals (lib.versionAtLeast version "14" && stdenv.hostPlatform.isDarwin) [
85 darwin.apple_sdk.frameworks.CoreServices
88 depsTargetTarget = optionals (
89 !withoutTargetLibc && threadsCross != { } && threadsCross.package != null
90 ) [ threadsCross.package ];