@@ -5381,6 +5381,7 @@ with pkgs;
5381
5381
gambit = callPackage ../development/compilers/gambit { };
5382
5382
gerbil = callPackage ../development/compilers/gerbil { };
5383
5383
5384
+ gccFun = callPackage ../development/compilers/gcc/6;
5384
5385
gcc = gcc6;
5385
5386
gcc-unwrapped = gcc.cc;
5386
5387
@@ -5429,19 +5430,27 @@ with pkgs;
5429
5430
cc = buildPackages.gccCrossStageStatic;
5430
5431
};
5431
5432
5433
+ # The GCC used to build libc for the target platform. Normal gccs will be
5434
+ # built with, and use, that cross-compiled libc.
5432
5435
gccCrossStageStatic = assert targetPlatform != buildPlatform; let
5433
5436
libcCross1 =
5434
5437
if targetPlatform.libc == "msvcrt" then __targetPackages.windows.mingw_w64_headers
5435
5438
else if targetPlatform.libc == "libSystem" then darwin.xcode
5436
5439
else null;
5437
5440
in wrapCCWith {
5438
5441
name = "gcc-cross-wrapper";
5439
- cc = gcc.cc.override {
5442
+ cc = gccFun {
5443
+ # copy-pasted
5444
+ inherit noSysDirs;
5445
+ # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion
5446
+ profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64));
5447
+ isl = if !stdenv.isDarwin then isl_0_14 else null;
5448
+
5449
+ # just for stage static
5440
5450
crossStageStatic = true;
5441
5451
langCC = false;
5442
5452
libcCross = libcCross1;
5443
5453
enableShared = false;
5444
- # Why is this needed?
5445
5454
};
5446
5455
libc = libcCross1;
5447
5456
};
@@ -5453,14 +5462,6 @@ with pkgs;
5453
5462
libc = windows.mingw_headers2;
5454
5463
};
5455
5464
5456
- gccCrossStageFinal = assert targetPlatform != buildPlatform; wrapCCWith {
5457
- name = "gcc-cross-wrapper";
5458
- cc = gcc.cc.override {
5459
- crossStageStatic = false;
5460
- };
5461
- libc = libcCross;
5462
- };
5463
-
5464
5465
gcc45 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.5 {
5465
5466
inherit noSysDirs;
5466
5467
texinfo = texinfo4;
@@ -6225,8 +6226,9 @@ with pkgs;
6225
6226
ccWrapperFun = callPackage ../build-support/cc-wrapper;
6226
6227
6227
6228
wrapCC = cc: wrapCCWith {
6229
+ name = lib.optionalString (targetPlatform != hostPlatform) "gcc-cross-wrapper";
6228
6230
inherit cc;
6229
- inherit ( stdenv.cc) libc;
6231
+ libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc. libc;
6230
6232
};
6231
6233
# legacy version, used for gnat bootstrapping
6232
6234
wrapGCC-old = baseGCC: callPackage ../build-support/gcc-wrapper-old {
0 commit comments