summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@yahoo.com>2017-09-21 18:57:16 -0400
committerGitHub <noreply@github.com>2017-09-21 18:57:16 -0400
commit56574e608706914f6b78557fc05e4705c7830945 (patch)
treec386bd52536cc515e3f57dac796c05da4f68c968 /pkgs
parent677371c5316ca19e257691dd2d5068dc6f24f024 (diff)
parentb9bf90ca6c7d980c9ff34d67fb3950c47b6be6b8 (diff)
downloadnixlib-56574e608706914f6b78557fc05e4705c7830945.tar
nixlib-56574e608706914f6b78557fc05e4705c7830945.tar.gz
nixlib-56574e608706914f6b78557fc05e4705c7830945.tar.bz2
nixlib-56574e608706914f6b78557fc05e4705c7830945.tar.lz
nixlib-56574e608706914f6b78557fc05e4705c7830945.tar.xz
nixlib-56574e608706914f6b78557fc05e4705c7830945.tar.zst
nixlib-56574e608706914f6b78557fc05e4705c7830945.zip
Merge pull request #29610 from obsidiansystems/no-gccCrossStageFinal
top-level: No `gccCrossStageFinal` needed anymore
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/gcc/4.5/default.nix6
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix6
-rw-r--r--pkgs/development/compilers/gcc/4.9/default.nix6
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix6
-rw-r--r--pkgs/development/compilers/gcc/6/default.nix6
-rw-r--r--pkgs/development/compilers/gcc/7/default.nix6
-rw-r--r--pkgs/development/compilers/gcc/snapshot/default.nix6
-rw-r--r--pkgs/os-specific/gnu/default.nix4
-rw-r--r--pkgs/stdenv/cross/default.nix2
-rw-r--r--pkgs/top-level/all-packages.nix24
-rw-r--r--pkgs/top-level/release-cross.nix2
11 files changed, 45 insertions, 29 deletions
diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix
index bec2aab017ea..5bad03d30252 100644
--- a/pkgs/development/compilers/gcc/4.5/default.nix
+++ b/pkgs/development/compilers/gcc/4.5/default.nix
@@ -20,7 +20,7 @@
 , enableMultilib ? false
 , name ? "gcc"
 , libcCross ? null
-, crossStageStatic ? true
+, crossStageStatic ? false
 , gnat ? null
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
 , stripped ? true
@@ -213,7 +213,9 @@ stdenv.mkDerivation ({
         ''
     else null;
 
-  inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
+  # TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
+  crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
+  inherit noSysDirs profiledCompiler staticCompiler langJava
     libcCross crossMingw;
 
   nativeBuildInputs = [ texinfo which gettext ]
diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index 5b9d368c457b..72e37f18a178 100644
--- a/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -26,7 +26,7 @@
 , enablePlugin ? true             # whether to support user-supplied plug-ins
 , name ? "gcc"
 , libcCross ? null
-, crossStageStatic ? true
+, crossStageStatic ? false
 , gnat ? null
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
 , stripped ? true
@@ -284,7 +284,9 @@ stdenv.mkDerivation ({
         ''
     else null;
 
-  inherit noSysDirs staticCompiler langJava crossStageStatic
+  # TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
+  crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
+  inherit noSysDirs staticCompiler langJava
     libcCross crossMingw;
 
   nativeBuildInputs = [ texinfo which gettext ]
diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix
index 8990302eea2e..d7684a61a2ac 100644
--- a/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/pkgs/development/compilers/gcc/4.9/default.nix
@@ -26,7 +26,7 @@
 , enablePlugin ? true             # whether to support user-supplied plug-ins
 , name ? "gcc"
 , libcCross ? null
-, crossStageStatic ? true
+, crossStageStatic ? false
 , gnat ? null
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
 , stripped ? true
@@ -280,7 +280,9 @@ stdenv.mkDerivation ({
         ''
     else null;
 
-  inherit noSysDirs staticCompiler langJava crossStageStatic
+  # TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
+  crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
+  inherit noSysDirs staticCompiler langJava
     libcCross crossMingw;
 
   nativeBuildInputs = [ texinfo which gettext ]
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index f593e00ccfd4..c3e14d9328e4 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -26,7 +26,7 @@
 , enablePlugin ? true             # whether to support user-supplied plug-ins
 , name ? "gcc"
 , libcCross ? null
-, crossStageStatic ? true
+, crossStageStatic ? false
 , gnat ? null
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
 , stripped ? true
@@ -299,7 +299,9 @@ stdenv.mkDerivation ({
         ''
     else null;
 
-  inherit noSysDirs staticCompiler langJava crossStageStatic
+  # TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
+  crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
+  inherit noSysDirs staticCompiler langJava
     libcCross crossMingw;
 
   nativeBuildInputs = [ texinfo which gettext ]
diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix
index 25940420e9a9..2c8a9696e693 100644
--- a/pkgs/development/compilers/gcc/6/default.nix
+++ b/pkgs/development/compilers/gcc/6/default.nix
@@ -26,7 +26,7 @@
 , enablePlugin ? true             # whether to support user-supplied plug-ins
 , name ? "gcc"
 , libcCross ? null
-, crossStageStatic ? true
+, crossStageStatic ? false
 , gnat ? null
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
 , stripped ? true
@@ -292,7 +292,9 @@ stdenv.mkDerivation ({
         ''
     else null;
 
-  inherit noSysDirs staticCompiler langJava crossStageStatic
+  # TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
+  crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
+  inherit noSysDirs staticCompiler langJava
     libcCross crossMingw;
 
   nativeBuildInputs = [ texinfo which gettext ]
diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix
index 6dcd36eb3ea2..064f2ab00d47 100644
--- a/pkgs/development/compilers/gcc/7/default.nix
+++ b/pkgs/development/compilers/gcc/7/default.nix
@@ -26,7 +26,7 @@
 , enablePlugin ? true             # whether to support user-supplied plug-ins
 , name ? "gcc"
 , libcCross ? null
-, crossStageStatic ? true
+, crossStageStatic ? false
 , gnat ? null
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
 , stripped ? true
@@ -294,7 +294,9 @@ stdenv.mkDerivation ({
         ''
     else null;
 
-  inherit noSysDirs staticCompiler langJava crossStageStatic
+  # TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
+  crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
+  inherit noSysDirs staticCompiler langJava
     libcCross crossMingw;
 
   nativeBuildInputs = [ texinfo which gettext ]
diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix
index 46fcc53b3c46..696417a49566 100644
--- a/pkgs/development/compilers/gcc/snapshot/default.nix
+++ b/pkgs/development/compilers/gcc/snapshot/default.nix
@@ -26,7 +26,7 @@
 , enablePlugin ? true             # whether to support user-supplied plug-ins
 , name ? "gcc"
 , libcCross ? null
-, crossStageStatic ? true
+, crossStageStatic ? false
 , gnat ? null
 , libpthread ? null, libpthreadCross ? null  # required for GNU/Hurd
 , stripped ? true
@@ -281,7 +281,9 @@ stdenv.mkDerivation ({
         ''
     else null;
 
-  inherit noSysDirs staticCompiler langJava crossStageStatic
+  # TODO(@Ericson2314): Make passthru instead. Weird to avoid mass rebuild,
+  crossStageStatic = targetPlatform == hostPlatform || crossStageStatic;
+  inherit noSysDirs staticCompiler langJava
     libcCross crossMingw;
 
   nativeBuildInputs = [ texinfo which gettext ]
diff --git a/pkgs/os-specific/gnu/default.nix b/pkgs/os-specific/gnu/default.nix
index fb3796394e81..478040132b82 100644
--- a/pkgs/os-specific/gnu/default.nix
+++ b/pkgs/os-specific/gnu/default.nix
@@ -2,7 +2,7 @@
 
 args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool
 , texinfo, glibcCross, hurdPartedCross, libuuid, samba
-, gccCrossStageStatic, gccCrossStageFinal
+, gccCrossStageStatic, gcc
 , forceSystem, newScope, platform, config
 , targetPlatform, buildPlatform
 , overrides ? {}
@@ -28,7 +28,7 @@ let
       automake = automake111x;
       headersOnly = false;
       cross = assert targetPlatform != buildPlatform; targetPlatform;
-      gccCross = gccCrossStageFinal;
+      gccCross = gcc;
     };
 
     hurdCrossIntermediate = forcedNativePackages.callPackage ./hurd {
diff --git a/pkgs/stdenv/cross/default.nix b/pkgs/stdenv/cross/default.nix
index c83714d01f2c..8197510eeecc 100644
--- a/pkgs/stdenv/cross/default.nix
+++ b/pkgs/stdenv/cross/default.nix
@@ -35,7 +35,7 @@ in bootStages ++ [
       targetPlatform = crossSystem;
       cc = if crossSystem.useiOSCross or false
            then buildPackages.darwin.ios-cross
-           else buildPackages.gccCrossStageFinal;
+           else buildPackages.gcc;
     };
   })
 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 0a0b02c62757..3ef812b388d1 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -5383,6 +5383,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;
 
@@ -5431,6 +5432,8 @@ with pkgs;
     cc = buildPackages.gccCrossStageStatic;
   };
 
+  # The GCC used to build libc for the target platform. Normal gccs will be
+  # built with, and use, that cross-compiled libc.
   gccCrossStageStatic = assert targetPlatform != buildPlatform; let
     libcCross1 =
       if targetPlatform.libc == "msvcrt" then __targetPackages.windows.mingw_w64_headers
@@ -5438,12 +5441,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;
   };
@@ -5455,14 +5464,6 @@ with pkgs;
     libc = windows.mingw_headers2;
   };
 
-  gccCrossStageFinal = assert targetPlatform != buildPlatform; wrapCCWith {
-    name = "gcc-cross-wrapper";
-    cc = gcc.cc.override {
-      crossStageStatic = false;
-    };
-    libc = libcCross;
-  };
-
   gcc45 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.5 {
     inherit noSysDirs;
     texinfo = texinfo4;
@@ -6227,8 +6228,9 @@ with pkgs;
   ccWrapperFun = callPackage ../build-support/cc-wrapper;
 
   wrapCC = cc: wrapCCWith {
+    name = lib.optionalString (targetPlatform != hostPlatform) "gcc-cross-wrapper";
     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 {
diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix
index 94c1e6c7ad2e..62f7134616bf 100644
--- a/pkgs/top-level/release-cross.nix
+++ b/pkgs/top-level/release-cross.nix
@@ -19,7 +19,7 @@ let
   };
 
   gnuCommon = lib.recursiveUpdate common {
-    buildPackages.gccCrossStageFinal = nativePlatforms;
+    buildPackages.gcc = nativePlatforms;
     coreutils = nativePlatforms;
   };