anchor.diff:      # contains the string "perl", Configure would select $out/lib.
       # Miniperl needs -lm. perl needs -lrt.
       configureFlags =
  -      [ "-de"
  -        "-Dcc=cc"
  +      (if crossCompiling
  +       then [ "-Dlibpth=\"\"" "-Dglibpth=\"\"" ]
  +       else [ "-de" "-Dcc=cc" ])
  +      ++ [
           "-Uinstallusrbinperl"
           "-Dinstallstyle=lib/perl5"
           "-Duseshrplib"
  
positive.code:       ++ optional stdenv.isSunOS "-Dcc=gcc"
        ++ optional enableThreading "-Dusethreads";
  
      configureScript = "${stdenv.shell} ./Configure";
  
      dontAddPrefix = true;
  
      enableParallelBuilding = true;
  
      preConfigure =
        ''
          configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
        '' + optionalString (stdenv.isArm || stdenv.isMips) ''
          configureFlagsArray=(-Dldflags="-lm -lrt")
  
negative.code:       maintainers = [ maintainers.eelco ];
        platforms = platforms.all;
      };
    } // stdenv.lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) rec {
      crossVersion = "1.1.8";
  
      perl-cross-src = fetchurlBoot {
        url = "https://github.com/arsv/perl-cross/releases/download/${crossVersion}/perl-cross-${crossVersion}.tar.gz";
        sha256 = "072j491rpz2qx2sngbg4flqh4lx5865zyql7b9lqm6s1kknjdrh8";
      };
  
      nativeBuildInputs = [ buildPackages.stdenv.cc ];
  
      postUnpack = ''
        unpackFile ${perl-cross-src}
        cp -R perl-cross-${crossVersion}/* perl-${version}/
      '';
  
      configurePlatforms = [ "build" "host" "target" ];
    });
  in rec {
    perl = perl524;
  
  