From 48bb7745e76d6fa67069f53a34ae416d66eb0ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Wed, 9 Dec 2009 10:05:47 +0000 Subject: [PATCH] gcc 4.4.2 is also affected by the wrong CPP passed to the configure script of the target libraries, as 4.3.4 I trigger the breaking build using uclibc, instead of glibc, and then the mixture of CPP getting the build glibc headers, and CC getting the uclibc headers, makes the problem evident. In 4.3.4 it only affected libmudflap. In 4.4.2, it affects libmudflap and libstdc++. svn path=/nixpkgs/branches/stdenv-updates/; revision=18850 --- pkgs/development/compilers/gcc-4.4/default.nix | 10 ++++++++-- pkgs/development/compilers/gcc-4.4/target-cpp.patch | 12 ++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/compilers/gcc-4.4/target-cpp.patch diff --git a/pkgs/development/compilers/gcc-4.4/default.nix b/pkgs/development/compilers/gcc-4.4/default.nix index 299c4cb9b39..fef453e4493 100644 --- a/pkgs/development/compilers/gcc-4.4/default.nix +++ b/pkgs/development/compilers/gcc-4.4/default.nix @@ -88,8 +88,14 @@ stdenv.mkDerivation ({ patches = [./pass-cxxcpp.patch -# ./libtool-glibc.patch # some libraries don't let the proper -Btargetglibcpath pass - ./libstdc++-target.patch # (fixed in gcc 4.4.3) bad mixture of build/target flags + + # libmudflap and libstdc++ receive the build CPP, + # and not the target. + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42279 + ./target-cpp.patch + + # (fixed in gcc 4.4.3) bad mixture of build/target flags + ./libstdc++-target.patch ] ++ optional noSysDirs ./no-sys-dirs.patch; diff --git a/pkgs/development/compilers/gcc-4.4/target-cpp.patch b/pkgs/development/compilers/gcc-4.4/target-cpp.patch new file mode 100644 index 00000000000..ab0f0ee51aa --- /dev/null +++ b/pkgs/development/compilers/gcc-4.4/target-cpp.patch @@ -0,0 +1,12 @@ +diff --git a/Makefile.in b/Makefile.in +index 8545b60..1fab64d 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -231,6 +231,7 @@ BASE_TARGET_EXPORTS = \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ ++ CPP="$(CC_FOR_TARGET) -E"; export CPP; \ + CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \