about summary refs log tree commit diff
path: root/pkgs/development/compilers/gcc/5/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/gcc/5/default.nix')
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index da4f7a606705..3e9104a82fbc 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -76,7 +76,8 @@ let version = "5.4.0";
       ++ optional langAda ../gnat-cflags.patch
       ++ optional langFortran ../gfortran-driving.patch
 
-      # This could be applied unconditionally but I don't want to cause a full Linux rebuild.
+      # This could be applied unconditionally but I don't want to cause a full
+      # Linux rebuild.
       ++ optional stdenv.cc.isClang ./libcxx38-and-above.patch;
 
     javaEcj = fetchurl {
@@ -234,6 +235,13 @@ stdenv.mkDerivation ({
 
   libc_dev = stdenv.cc.libc_dev;
 
+  # This should kill all the stdinc frameworks that gcc and friends like to
+  # insert into default search paths.
+  prePatch = if stdenv.isDarwin then ''
+    substituteInPlace gcc/config/darwin-c.c \
+      --replace 'if (stdinc)' 'if (0)'
+  '' else null;
+
   postPatch =
     if (stdenv.isGNU
         || (libcCross != null                  # e.g., building `gcc.crossDrv'