anchor.diff:      # Rename needed libraries and binaries, fix interpreter
       lib.optionalString stdenv.isLinux ''
         find . -type f -perm -0100 -exec patchelf \
  -          --interpreter ${glibcDynLinker} {} \;
  -    '' +
  -    # We're kludging a glibc bindist into working with non-glibc...
  -    # Here we patch up the use of `__strdup` (part of glibc binary ABI)
  -    # to instead use `strdup` since musl doesn't provide __strdup
  -    # (`__strdup` is defined to be an alias of `strdup` anyway[1]).
  -    # [1] http://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/baselib---strdup-1.html
  -    # Use objcopy magic to make the change:
  -    lib.optionalString stdenv.hostPlatform.isMusl ''
  -      find ./ghc-${version}/rts -name "libHSrts*.a" -exec ''${OBJCOPY:-objcopy} --redefine-sym __strdup=strdup {} \;
  +          --interpreter ${stdenv.cc.bintools.dynamicLinker} {} \;
       '';
   
     # fix for `configure: error: Your linker is affected by binutils #16177`
  
positive.code:     find $out -type f -name '*.p_o' -delete
      find $out -type f -name '*.p_hi' -delete
      find $out -type f -name '*_p.a' -delete
      rm $out/lib/ghc-*/bin/ghc-iserv-prof
      # Hydra will redistribute this derivation, so we have to keep the docs for
      # legal reasons (retaining the legal notices etc)
      # As a last resort we could unpack the docs separately and symlink them in.
      # They're in $out/share/{doc,man}.
    '';
  
    doInstallCheck = true;
    installCheckPhase = ''
  
negative.code: 
    configurePlatforms = [ ];
    configureFlags = [
      # Note that musl-based bindists seem to do nothing with the
      # `--with-gmp-libraries` flag, see:
      # https://gitlab.haskell.org/ghc/ghc/-/issues/20073#note_363231
      "--with-gmp-libraries=${lib.getLib gmp}/lib"
      "--with-gmp-includes=${lib.getDev gmp}/include"
    ] ++ lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"
  