about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2014-01-03 10:33:03 +0100
committerVladimír Čunát <vcunat@gmail.com>2014-01-03 10:42:46 +0100
commit86802e68ffd1981af92303a7a8a91a2723ca84ca (patch)
treebae7624d31a0e236deb5a9ec24a5c7d2b4b37b59
parentc6b92053c9e38238a29ed78b7ba1e3e5f569fe83 (diff)
downloadnixlib-86802e68ffd1981af92303a7a8a91a2723ca84ca.tar
nixlib-86802e68ffd1981af92303a7a8a91a2723ca84ca.tar.gz
nixlib-86802e68ffd1981af92303a7a8a91a2723ca84ca.tar.bz2
nixlib-86802e68ffd1981af92303a7a8a91a2723ca84ca.tar.lz
nixlib-86802e68ffd1981af92303a7a8a91a2723ca84ca.tar.xz
nixlib-86802e68ffd1981af92303a7a8a91a2723ca84ca.tar.zst
nixlib-86802e68ffd1981af92303a7a8a91a2723ca84ca.zip
gcc-4.{7,8}: hacky fix for parallel builds
The hash of stdenv is unchanged, as we use profiled compiler,
which has parallel builds disabled (conditional patch).
-rw-r--r--pkgs/development/compilers/gcc/4.7/default.nix17
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix21
-rw-r--r--pkgs/development/compilers/gcc/4.8/parallel-bconfig.patch32
3 files changed, 56 insertions, 14 deletions
diff --git a/pkgs/development/compilers/gcc/4.7/default.nix b/pkgs/development/compilers/gcc/4.7/default.nix
index 951288dc0244..6c71a0d640f8 100644
--- a/pkgs/development/compilers/gcc/4.7/default.nix
+++ b/pkgs/development/compilers/gcc/4.7/default.nix
@@ -54,7 +54,18 @@ let version = "4.7.3";
     # Whether building a cross-compiler for GNU/Hurd.
     crossGNU = cross != null && cross.config == "i586-pc-gnu";
 
+  /* gccinstall.info says that "parallel make is currently not supported since
+     collisions in profile collecting may occur".
+
+     Parallel make of gfortran is disabled because of an apparent race
+     condition concerning the generation of "bconfig.h". Please try and
+     re-enable parallel make for a later release of gfortran to check whether
+     the error has been fixed.
+  */
+    enableParallelBuilding = !profiledCompiler && !langFortran;
+
     patches = []
+      ++ optional enableParallelBuilding ../4.8/parallel-bconfig.patch
       ++ optional stdenv.isArm [ ./arm-eabi.patch ]
       ++ optional (cross != null) ./libstdc++-target.patch
       # ++ optional noSysDirs ./no-sys-dirs.patch
@@ -481,11 +492,7 @@ stdenv.mkDerivation ({
   passthru = { inherit langC langCC langAda langFortran langVhdl
       langGo enableMultilib version; };
 
-  /* From gccinstall.info:
-     "parallel make is currently not supported since collisions in profile
-     collecting may occur"
-  */
-  enableParallelBuilding = !profiledCompiler;
+  inherit enableParallelBuilding;
 
   meta = {
     homepage = http://gcc.gnu.org/;
diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index 3d42ae2ca3f7..67c50d420f53 100644
--- a/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -57,7 +57,18 @@ let version = "4.8.2";
     # Whether building a cross-compiler for GNU/Hurd.
     crossGNU = cross != null && cross.config == "i586-pc-gnu";
 
+  /* gccinstall.info says that "parallel make is currently not supported since
+     collisions in profile collecting may occur".
+
+     Parallel make of gfortran is disabled because of an apparent race
+     condition concerning the generation of "bconfig.h". Please try and
+     re-enable parallel make for a later release of gfortran to check whether
+     the error has been fixed.
+  */
+    enableParallelBuilding = !profiledCompiler && !langFortran;
+
     patches = []
+      ++ optional enableParallelBuilding ./parallel-bconfig.patch
       ++ optional stdenv.isArm [ ./arm-eabi.patch ]
       ++ optional (cross != null) ./libstdc++-target.patch
       # ++ optional noSysDirs ./no-sys-dirs.patch
@@ -484,15 +495,7 @@ stdenv.mkDerivation ({
   passthru = { inherit langC langCC langAda langFortran langVhdl
       langGo enableMultilib version; };
 
-  /* gccinstall.info says that "parallel make is currently not supported since
-     collisions in profile collecting may occur".
-
-     Parallel make of gfortran is disabled because of an apparent race
-     condition concerning the generation of "bconfig.h". Please try and
-     re-enable parallel make for a later release of gfortran to check whether
-     the error has been fixed.
-   */
-     enableParallelBuilding = !profiledCompiler && !langFortran;
+  inherit enableParallelBuilding;
 
   meta = {
     homepage = http://gcc.gnu.org/;
diff --git a/pkgs/development/compilers/gcc/4.8/parallel-bconfig.patch b/pkgs/development/compilers/gcc/4.8/parallel-bconfig.patch
new file mode 100644
index 000000000000..bc56ac698f5a
--- /dev/null
+++ b/pkgs/development/compilers/gcc/4.8/parallel-bconfig.patch
@@ -0,0 +1,32 @@
+Hacky work-around for highly parallel builds.
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57125
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index aad927c..182f666 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -3908,21 +3908,21 @@ build/gengtype-lex.o: $(BCONFIG_H)
+ 
+ gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
+   $(SYSTEM_H)
+-gengtype-parse.o: $(CONFIG_H)
++gengtype-parse.o: $(CONFIG_H) $(BCONFIG_H)
+ CFLAGS-gengtype-parse.o += -DGENERATOR_FILE
+ build/gengtype-parse.o: $(BCONFIG_H)
+ 
+ gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
+   gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
+   $(XREGEX_H)
+-gengtype-state.o: $(CONFIG_H)
++gengtype-state.o: $(CONFIG_H) $(BCONFIG_H)
+ CFLAGS-gengtype-state.o += -DGENERATOR_FILE
+ build/gengtype-state.o: $(BCONFIG_H)
+ 
+ gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h 	\
+   rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \
+   $(OBSTACK_H) $(XREGEX_H)
+-gengtype.o: $(CONFIG_H)
++gengtype.o: $(CONFIG_H) $(BCONFIG_H)
+ CFLAGS-gengtype.o += -DGENERATOR_FILE
+ build/gengtype.o: $(BCONFIG_H)
+