From bf3476c7d2b80938218741f9fe907a2fc22e8cb3 Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Tue, 14 Jan 2014 00:43:06 +0100 Subject: [PATCH] gcc: Fix build error on gcc 4.7 Specifically, we are trying to fix the following error seen on Hydra: ../../gcc-4.7.3/gcc/gengtype-lex.c:1:21: fatal error: bconfig.h: No such file or directory The patch is taken from gcc's SVN revision 193691. --- pkgs/development/compilers/gcc/4.7/build-race.patch | 11 +++++++++++ pkgs/development/compilers/gcc/4.7/default.nix | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/compilers/gcc/4.7/build-race.patch diff --git a/pkgs/development/compilers/gcc/4.7/build-race.patch b/pkgs/development/compilers/gcc/4.7/build-race.patch new file mode 100644 index 000000000000..4d7607076d66 --- /dev/null +++ b/pkgs/development/compilers/gcc/4.7/build-race.patch @@ -0,0 +1,11 @@ +--- gcc-4.7.3/gcc/Makefile.in 2013-04-01 10:11:11.000000000 +0200 ++++ gcc-4.7.3/gcc/Makefile.in.new 2014-01-14 00:55:31.056406483 +0100 +@@ -3904,7 +3904,7 @@ + $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h + build/gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def + gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H) +-gengtype-lex.o: $(CONFIG_H) ++gengtype-lex.o: $(CONFIG_H) $(BCONFIG_H) + build/gengtype-lex.o: $(BCONFIG_H) + gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \ + $(SYSTEM_H) diff --git a/pkgs/development/compilers/gcc/4.7/default.nix b/pkgs/development/compilers/gcc/4.7/default.nix index 4f260d75afcc..da2d8c33161f 100644 --- a/pkgs/development/compilers/gcc/4.7/default.nix +++ b/pkgs/development/compilers/gcc/4.7/default.nix @@ -54,8 +54,9 @@ let version = "4.7.3"; # Whether building a cross-compiler for GNU/Hurd. crossGNU = cross != null && cross.config == "i586-pc-gnu"; - patches = [] - ++ optional stdenv.isArm [ ./arm-eabi.patch ] + patches = [ + ./build-race.patch + ] ++ optional stdenv.isArm [ ./arm-eabi.patch ] ++ optional (cross != null) ./libstdc++-target.patch # ++ optional noSysDirs ./no-sys-dirs.patch # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its