Unverified Commit 23bb0627 authored by Artturi's avatar Artturi Committed by GitHub
Browse files

Merge pull request #239247 from Artturin/fixlinkergold

parents f3ae2d0e 3d03da5e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ in
, zlib

, enableGold ? withGold stdenv.targetPlatform
, enableGoldDefault ? false
, enableShared ? !stdenv.hostPlatform.isStatic
  # WARN: Enabling all targets increases output size to a multiple.
, withAllTargets ? false
@@ -26,6 +27,7 @@ in
# WARN: configure silently disables ld.gold if it's unsupported, so we need to
# make sure that intent matches result ourselves.
assert enableGold -> withGold stdenv.targetPlatform;
assert enableGoldDefault -> enableGold;


let
@@ -217,8 +219,10 @@ stdenv.mkDerivation (finalAttrs: {
    "--with-lib-path=:"
  ]
  ++ lib.optionals withAllTargets [ "--enable-targets=all" ]
  ++ lib.optionals enableGold [ "--enable-gold" "--enable-plugins" ]
  ++ (if enableShared
  ++ lib.optionals enableGold [
    "--enable-gold${lib.optionalString enableGoldDefault "=default"}"
    "--enable-plugins"
  ] ++ (if enableShared
      then [ "--enable-shared" "--disable-static" ]
      else [ "--disable-shared" "--enable-static" ])
  ;
+1 −1
Original line number Diff line number Diff line
@@ -18392,7 +18392,7 @@ with pkgs;
  in     if linker == "lld"     then llvmPackages.bintools-unwrapped
    else if linker == "cctools" then darwin.binutils-unwrapped
    else if linker == "bfd"     then binutils-unwrapped
    else if linker == "gold"    then binutils-unwrapped
    else if linker == "gold"    then binutils-unwrapped.override { enableGoldDefault = true; }
    else null;
  bintoolsNoLibc = wrapBintoolsWith {
    bintools = bintools-unwrapped;