@@ -5377,6 +5377,7 @@ with pkgs;
53775377 gambit = callPackage ../development/compilers/gambit { };
53785378 gerbil = callPackage ../development/compilers/gerbil { };
53795379
5380+ gccFun = callPackage ../development/compilers/gcc/6;
53805381 gcc = gcc6;
53815382 gcc-unwrapped = gcc.cc;
53825383
@@ -5432,12 +5433,18 @@ with pkgs;
54325433 else null;
54335434 in wrapCCWith {
54345435 name = "gcc-cross-wrapper";
5435− cc = gcc.cc.override {
5436+ cc = gccFun {
5437+ # copy-pasted
5438+ inherit noSysDirs;
5439+ # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion
5440+ profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));
5441+ isl = if !stdenv.isDarwin then isl_0_14 else null;
5442+
5443+ # just for stage static
54365444 crossStageStatic = true;
54375445 langCC = false;
54385446 libcCross = libcCross1;
54395447 enableShared = false;
5440− # Why is this needed?
54415448 };
54425449 libc = libcCross1;
54435450 };
@@ -6220,7 +6227,7 @@ with pkgs;
62206227
62216228 wrapCC = cc: wrapCCWith {
62226229 inherit cc;
6223− inherit (stdenv.cc) libc;
6230+ libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc;
62246231 };
62256232 # legacy version, used for gnat bootstrapping
62266233 wrapGCC-old = baseGCC: callPackage ../build-support/gcc-wrapper-old {