This reverts commits cb7c053383ff76a454484992b3a6d6a2f1530c15, ebda45e6b9db3225c30a998b2624d90b0c08edb4, 4a495cfbab2b3ab9ae8219ef1812c766bf27b01e because they broke Nixpkgs evaluation.
···3232, gnat ? null
3333, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
3434, stripped ? true
3535-, CF ? null
3535+, gnused ? null
3636}:
37373838assert langJava -> zip != null && unzip != null
···4747# LTO needs libelf and zlib.
4848assert libelf != null -> zlib != null;
49495050-# Make sure we get CoreFoundation
5151-assert stdenv.isDarwin -> CF != null;
5050+# Make sure we get GNU sed.
5151+assert stdenv.isDarwin -> gnused != null;
52525353# The go frontend is written in c++
5454assert langGo -> langCC;
···288288 ++ (optionals (cross != null) [binutilsCross])
289289 ++ (optionals langAda [gnatboot])
290290 ++ (optionals langVhdl [gnat])
291291+292292+ # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
293293+ # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
294294+ ++ (optional stdenv.isDarwin gnused)
291295 ;
292296293297 NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl";
···298302 export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
299303 export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
300304 '' + stdenv.lib.optionalString stdenv.isDarwin ''
301301- configureFlagsArray+=(
302302- --with-sysroot="${stdenv.libc}"
303303- --with-native-system-header-dir=/include
304304- )
305305+ if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
306306+ configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
307307+ makeFlagsArray+=( \
308308+ CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
309309+ CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
310310+ FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
311311+ )
312312+ fi
305313 '';
306314307315 dontDisableStatic = true;
···470478 ++ optionals javaAwtGtk [ gmp mpfr ]
471479 ++ optional (libpthread != null) libpthread)));
472480473473- extraFlags =
474474- (if cross != null && libcCross != null
481481+ EXTRA_TARGET_CFLAGS =
482482+ if cross != null && libcCross != null
475483 then "-idirafter ${libcCross}/include"
476476- else "") + optionalString stdenv.isDarwin " -F${CF}/Library/Frameworks";
484484+ else null;
477485478486 EXTRA_TARGET_LDFLAGS =
479487 if cross != null && libcCross != null
+18-10
pkgs/development/compilers/gcc/4.9/default.nix
···3232, gnat ? null
3333, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
3434, stripped ? true
3535-, CF ? null
3535+, gnused ? null
3636}:
37373838assert langJava -> zip != null && unzip != null
···4747# LTO needs libelf and zlib.
4848assert libelf != null -> zlib != null;
49495050-# Make sure we get CoreFoundation
5151-assert stdenv.isDarwin -> CF != null;
5050+# Make sure we get GNU sed.
5151+assert stdenv.isDarwin -> gnused != null;
52525353# The go frontend is written in c++
5454assert langGo -> langCC;
···287287 ++ (optionals (cross != null) [binutilsCross])
288288 ++ (optionals langAda [gnatboot])
289289 ++ (optionals langVhdl [gnat])
290290+291291+ # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
292292+ # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
293293+ ++ (optional stdenv.isDarwin gnused)
290294 ;
291295292296 NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl";
···297301 export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
298302 export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
299303 '' + stdenv.lib.optionalString stdenv.isDarwin ''
300300- configureFlagsArray+=(
301301- --with-sysroot="${stdenv.libc}"
302302- --with-native-system-header-dir=/include
303303- )
304304+ if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
305305+ configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
306306+ makeFlagsArray+=( \
307307+ CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
308308+ CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
309309+ FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
310310+ )
311311+ fi
304312 '';
305313306314 dontDisableStatic = true;
···469477 ++ optionals javaAwtGtk [ gmp mpfr ]
470478 ++ optional (libpthread != null) libpthread)));
471479472472- extraFlags =
473473- (if cross != null && libcCross != null
480480+ EXTRA_TARGET_CFLAGS =
481481+ if cross != null && libcCross != null
474482 then "-idirafter ${libcCross}/include"
475475- else "") + optionalString stdenv.isDarwin " -F${CF}/Library/Frameworks";
483483+ else null;
476484477485 EXTRA_TARGET_LDFLAGS =
478486 if cross != null && libcCross != null
+23-10
pkgs/development/compilers/gcc/5/default.nix
···3232, gnat ? null
3333, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
3434, stripped ? true
3535-, CF ? null
3535+, gnused ? null
3636+, binutils ? null
3637}:
37383839assert langJava -> zip != null && unzip != null
···4445# LTO needs libelf and zlib.
4546assert libelf != null -> zlib != null;
46474747-# Make sure we get CoreFoundation.
4848-assert stdenv.isDarwin -> CF != null;
4848+# Make sure we get GNU sed.
4949+assert stdenv.isDarwin -> gnused != null;
5050+5151+# Need c++filt on darwin
5252+assert stdenv.isDarwin -> binutils != null;
49535054# The go frontend is written in c++
5155assert langGo -> langCC;
···282286 ++ (optionals (cross != null) [binutilsCross])
283287 ++ (optionals langAda [gnatboot])
284288 ++ (optionals langVhdl [gnat])
289289+290290+ # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
291291+ # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
292292+ ++ (optional stdenv.isDarwin gnused)
293293+ ++ (optional stdenv.isDarwin binutils)
285294 ;
286295287296 NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl";
···292301 export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
293302 export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
294303 '' + stdenv.lib.optionalString stdenv.isDarwin ''
295295- configureFlagsArray+=(
296296- --with-sysroot="${stdenv.libc}"
297297- --with-native-system-header-dir=/include
298298- )
304304+ if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
305305+ configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
306306+ makeFlagsArray+=( \
307307+ CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
308308+ CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
309309+ FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
310310+ )
311311+ fi
299312 '';
300313301314 dontDisableStatic = true;
···462475 ++ optionals javaAwtGtk [ gmp mpfr ]
463476 ++ optional (libpthread != null) libpthread)));
464477465465- extraFlags =
466466- (if cross != null && libcCross != null
478478+ EXTRA_TARGET_CFLAGS =
479479+ if cross != null && libcCross != null
467480 then "-idirafter ${libcCross}/include"
468468- else "") + optionalString stdenv.isDarwin " -F${CF}/Library/Frameworks";
481481+ else null;
469482470483 EXTRA_TARGET_LDFLAGS =
471484 if cross != null && libcCross != null
+2-5
pkgs/development/compilers/gcc/builder.sh
···23232424 # Figure out what extra flags to pass to the gcc compilers
2525 # being generated to make sure that they use our glibc.
2626- extraFlags="$(cat $NIX_CC/nix-support/libc-cflags) ${extraFlags}"
2727- extraLDFlags="$(cat $NIX_CC/nix-support/libc-ldflags)"
2828- if [ -e "$NIX_CC/nix-support/libc-ldflags-before" ]; then
2929- extraLDFlags+=" $(cat $NIX_CC/nix-support/libc-ldflags-before)"
3030- fi
2626+ extraFlags="$(cat $NIX_CC/nix-support/libc-cflags)"
2727+ extraLDFlags="$(cat $NIX_CC/nix-support/libc-ldflags) $(cat $NIX_CC/nix-support/libc-ldflags-before)"
31283229 # Use *real* header files, otherwise a limits.h is generated
3330 # that does not include Glibc's limits.h (notably missing