@@ -165,8 +165,8 @@ let version = "6.2.0";
165165 " --disable-libatomic " + # libatomic requires libc
166166 " --disable-decimal-float" # libdecnumber requires libc
167167 else
168− (if crossDarwin then " --with-sysroot=${libcCross.out}/share/sysroot"
169− else " --with-headers=${libcCross.dev}/include") +
168+ (if crossDarwin then " --with-sysroot=${getLib libcCross}/share/sysroot"
169+ else " --with-headers=${getDev libcCross}/include") +
170170 # Ensure that -print-prog-name is able to find the correct programs.
171171 (stdenv.lib.optionalString (crossMingw || crossDarwin) (
172172 " --with-as=${binutilsCross}/bin/${cross.config}-as" +
@@ -247,7 +247,7 @@ stdenv.mkDerivation ({
247247 ++ stdenv.lib.optional (libpthread != null) libpthread;
248248 extraCPPSpec =
249249 concatStrings (intersperse " "
250− (map (x: "-I${x}/include") extraCPPDeps));
250+ (map (x: "-I${x.dev or x}/include") extraCPPDeps));
251251 extraLibSpec =
252252 if libpthreadCross != null
253253 then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}"
@@ -411,6 +411,7 @@ stdenv.mkDerivation ({
411411 ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
412412 --with-gmp=${gmp.crossDrv}
413413 --with-mpfr=${mpfr.crossDrv}
414+ --with-mpc=${libmpc.crossDrv}
414415 --disable-libstdcxx-pch
415416 --without-included-gettext
416417 --with-system-zlib
@@ -456,7 +457,7 @@ stdenv.mkDerivation ({
456457 # Likewise, the LTO code doesn't find zlib.
457458
458459 CPATH = concatStrings
459− (intersperse ":" (map (x: x + "/include")
460+ (intersperse ":" (map (x: "${x.dev or x}/include")
460461 (optionals (zlib != null) [ zlib ]
461462 ++ optionals langJava [ boehmgc ]
462463 ++ optionals javaAwtGtk xlibs
@@ -479,7 +480,7 @@ stdenv.mkDerivation ({
479480
480481 EXTRA_TARGET_CFLAGS =
481482 if cross != null && libcCross != null then [
482− "-idirafter ${libcCross.dev}/include"
483+ "-idirafter ${getDev libcCross}/include"
483484 ]
484485 ++ optionals (! crossStageStatic) [
485486 "-B${libcCross.out}/lib"