This reverts commits cb7c053383ff76a454484992b3a6d6a2f1530c15, ebda45e6b9db3225c30a998b2624d90b0c08edb4, 4a495cfbab2b3ab9ae8219ef1812c766bf27b01e because they broke Nixpkgs evaluation.
···32, gnat ? null
33, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
34, stripped ? true
35+, gnused ? null
36+, binutils ? null
37}:
3839assert langJava -> zip != null && unzip != null
···45# LTO needs libelf and zlib.
46assert libelf != null -> zlib != null;
4748+# Make sure we get GNU sed.
49+assert stdenv.isDarwin -> gnused != null;
50+51+# Need c++filt on darwin
52+assert stdenv.isDarwin -> binutils != null;
5354# The go frontend is written in c++
55assert langGo -> langCC;
···286 ++ (optionals (cross != null) [binutilsCross])
287 ++ (optionals langAda [gnatboot])
288 ++ (optionals langVhdl [gnat])
289+290+ # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
291+ # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
292+ ++ (optional stdenv.isDarwin gnused)
293+ ++ (optional stdenv.isDarwin binutils)
294 ;
295296 NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl";
···301 export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
302 export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
303 '' + stdenv.lib.optionalString stdenv.isDarwin ''
304+ if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
305+ configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
306+ makeFlagsArray+=( \
307+ CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
308+ CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
309+ FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
310+ )
311+ fi
312 '';
313314 dontDisableStatic = true;
···475 ++ optionals javaAwtGtk [ gmp mpfr ]
476 ++ optional (libpthread != null) libpthread)));
477478+ EXTRA_TARGET_CFLAGS =
479+ if cross != null && libcCross != null
480 then "-idirafter ${libcCross}/include"
481+ else null;
482483 EXTRA_TARGET_LDFLAGS =
484 if cross != null && libcCross != null
+2-5
pkgs/development/compilers/gcc/builder.sh
···2324 # Figure out what extra flags to pass to the gcc compilers
25 # being generated to make sure that they use our glibc.
26- extraFlags="$(cat $NIX_CC/nix-support/libc-cflags) ${extraFlags}"
27- extraLDFlags="$(cat $NIX_CC/nix-support/libc-ldflags)"
28- if [ -e "$NIX_CC/nix-support/libc-ldflags-before" ]; then
29- extraLDFlags+=" $(cat $NIX_CC/nix-support/libc-ldflags-before)"
30- fi
3132 # Use *real* header files, otherwise a limits.h is generated
33 # that does not include Glibc's limits.h (notably missing
···2324 # Figure out what extra flags to pass to the gcc compilers
25 # being generated to make sure that they use our glibc.
26+ extraFlags="$(cat $NIX_CC/nix-support/libc-cflags)"
27+ extraLDFlags="$(cat $NIX_CC/nix-support/libc-ldflags) $(cat $NIX_CC/nix-support/libc-ldflags-before)"
0002829 # Use *real* header files, otherwise a limits.h is generated
30 # that does not include Glibc's limits.h (notably missing