From 88a0e55ce01867e3f8ba177bf128ed1f63376d92 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 20 Sep 2017 15:20:00 -0400 Subject: [PATCH] wrapCC: Alias now does the right thing for cross Unfortunately this makes previously-barely-working overrides have infinite recursion, so I had to reinstantiate gcc for gccCrossStageFinal instead. --- pkgs/top-level/all-packages.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 655d464e66c..73d65d4ad08 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5377,6 +5377,7 @@ with pkgs; gambit = callPackage ../development/compilers/gambit { }; gerbil = callPackage ../development/compilers/gerbil { }; + gccFun = callPackage ../development/compilers/gcc/6; gcc = gcc6; gcc-unwrapped = gcc.cc; @@ -5432,12 +5433,18 @@ with pkgs; else null; in wrapCCWith { name = "gcc-cross-wrapper"; - cc = gcc.cc.override { + cc = gccFun { + # copy-pasted + inherit noSysDirs; + # PGO seems to speed up compilation by gcc by ~10%, see #445 discussion + profiledCompiler = with stdenv; (!isDarwin && (isi686 || isx86_64)); + isl = if !stdenv.isDarwin then isl_0_14 else null; + + # just for stage static crossStageStatic = true; langCC = false; libcCross = libcCross1; enableShared = false; - # Why is this needed? }; libc = libcCross1; }; @@ -6220,7 +6227,7 @@ with pkgs; wrapCC = cc: wrapCCWith { inherit cc; - inherit (stdenv.cc) libc; + libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc; }; # legacy version, used for gnat bootstrapping wrapGCC-old = baseGCC: callPackage ../build-support/gcc-wrapper-old {