diff --git a/pkgs/development/compilers/gcc-4.5/default.nix b/pkgs/development/compilers/gcc-4.5/default.nix index 62a4e01803d..6f7854794b7 100644 --- a/pkgs/development/compilers/gcc-4.5/default.nix +++ b/pkgs/development/compilers/gcc-4.5/default.nix @@ -143,6 +143,27 @@ stdenv.mkDerivation ({ ++ optional langVhdl ./ghdl-ortho-cflags.patch ; + postPatch = + if (stdenv.system == "i586-pc-gnu" + || (cross != null && cross.config == "i586-pc-gnu" + && libcCross != null)) + then + # On GNU/Hurd glibc refers to Hurd & Mach headers so add the right `-I' + # flags to the default spec string. + let + libc = if cross != null then libcCross else stdenv.glibc; + config_h = "gcc/config/i386/gnu.h"; + extraCPPSpec = + concatStrings (intersperse " " + (map (x: "-I${x}/include") + libc.propagatedBuildInputs)); + in + '' echo "augmenting \`CPP_SPEC' in \`${config_h}' with \`${extraCPPSpec}'..." + sed -i "${config_h}" \ + -es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g' + '' + else null; + inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic libcCross crossMingw;