lol

Revert gcc darwin fixes

This reverts commits cb7c053383ff76a454484992b3a6d6a2f1530c15,
ebda45e6b9db3225c30a998b2624d90b0c08edb4,
4a495cfbab2b3ab9ae8219ef1812c766bf27b01e because they broke Nixpkgs
evaluation.

http://hydra.nixos.org/build/24813270

+61 -41
+18 -10
pkgs/development/compilers/gcc/4.8/default.nix
··· 32 32 , gnat ? null 33 33 , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd 34 34 , stripped ? true 35 - , CF ? null 35 + , gnused ? null 36 36 }: 37 37 38 38 assert langJava -> zip != null && unzip != null ··· 47 47 # LTO needs libelf and zlib. 48 48 assert libelf != null -> zlib != null; 49 49 50 - # Make sure we get CoreFoundation 51 - assert stdenv.isDarwin -> CF != null; 50 + # Make sure we get GNU sed. 51 + assert stdenv.isDarwin -> gnused != null; 52 52 53 53 # The go frontend is written in c++ 54 54 assert langGo -> langCC; ··· 288 288 ++ (optionals (cross != null) [binutilsCross]) 289 289 ++ (optionals langAda [gnatboot]) 290 290 ++ (optionals langVhdl [gnat]) 291 + 292 + # The builder relies on GNU sed (for instance, Darwin's `sed' fails with 293 + # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it. 294 + ++ (optional stdenv.isDarwin gnused) 291 295 ; 292 296 293 297 NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl"; ··· 298 302 export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET" 299 303 export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET" 300 304 '' + stdenv.lib.optionalString stdenv.isDarwin '' 301 - configureFlagsArray+=( 302 - --with-sysroot="${stdenv.libc}" 303 - --with-native-system-header-dir=/include 304 - ) 305 + if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then 306 + configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include) 307 + makeFlagsArray+=( \ 308 + CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \ 309 + CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \ 310 + FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \ 311 + ) 312 + fi 305 313 ''; 306 314 307 315 dontDisableStatic = true; ··· 470 478 ++ optionals javaAwtGtk [ gmp mpfr ] 471 479 ++ optional (libpthread != null) libpthread))); 472 480 473 - extraFlags = 474 - (if cross != null && libcCross != null 481 + EXTRA_TARGET_CFLAGS = 482 + if cross != null && libcCross != null 475 483 then "-idirafter ${libcCross}/include" 476 - else "") + optionalString stdenv.isDarwin " -F${CF}/Library/Frameworks"; 484 + else null; 477 485 478 486 EXTRA_TARGET_LDFLAGS = 479 487 if cross != null && libcCross != null
+18 -10
pkgs/development/compilers/gcc/4.9/default.nix
··· 32 32 , gnat ? null 33 33 , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd 34 34 , stripped ? true 35 - , CF ? null 35 + , gnused ? null 36 36 }: 37 37 38 38 assert langJava -> zip != null && unzip != null ··· 47 47 # LTO needs libelf and zlib. 48 48 assert libelf != null -> zlib != null; 49 49 50 - # Make sure we get CoreFoundation 51 - assert stdenv.isDarwin -> CF != null; 50 + # Make sure we get GNU sed. 51 + assert stdenv.isDarwin -> gnused != null; 52 52 53 53 # The go frontend is written in c++ 54 54 assert langGo -> langCC; ··· 287 287 ++ (optionals (cross != null) [binutilsCross]) 288 288 ++ (optionals langAda [gnatboot]) 289 289 ++ (optionals langVhdl [gnat]) 290 + 291 + # The builder relies on GNU sed (for instance, Darwin's `sed' fails with 292 + # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it. 293 + ++ (optional stdenv.isDarwin gnused) 290 294 ; 291 295 292 296 NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl"; ··· 297 301 export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET" 298 302 export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET" 299 303 '' + stdenv.lib.optionalString stdenv.isDarwin '' 300 - configureFlagsArray+=( 301 - --with-sysroot="${stdenv.libc}" 302 - --with-native-system-header-dir=/include 303 - ) 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 304 312 ''; 305 313 306 314 dontDisableStatic = true; ··· 469 477 ++ optionals javaAwtGtk [ gmp mpfr ] 470 478 ++ optional (libpthread != null) libpthread))); 471 479 472 - extraFlags = 473 - (if cross != null && libcCross != null 480 + EXTRA_TARGET_CFLAGS = 481 + if cross != null && libcCross != null 474 482 then "-idirafter ${libcCross}/include" 475 - else "") + optionalString stdenv.isDarwin " -F${CF}/Library/Frameworks"; 483 + else null; 476 484 477 485 EXTRA_TARGET_LDFLAGS = 478 486 if cross != null && libcCross != null
+23 -10
pkgs/development/compilers/gcc/5/default.nix
··· 32 32 , gnat ? null 33 33 , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd 34 34 , stripped ? true 35 - , CF ? null 35 + , gnused ? null 36 + , binutils ? null 36 37 }: 37 38 38 39 assert langJava -> zip != null && unzip != null ··· 44 45 # LTO needs libelf and zlib. 45 46 assert libelf != null -> zlib != null; 46 47 47 - # Make sure we get CoreFoundation. 48 - assert stdenv.isDarwin -> CF != null; 48 + # 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; 49 53 50 54 # The go frontend is written in c++ 51 55 assert langGo -> langCC; ··· 282 286 ++ (optionals (cross != null) [binutilsCross]) 283 287 ++ (optionals langAda [gnatboot]) 284 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) 285 294 ; 286 295 287 296 NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl"; ··· 292 301 export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET" 293 302 export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET" 294 303 '' + stdenv.lib.optionalString stdenv.isDarwin '' 295 - configureFlagsArray+=( 296 - --with-sysroot="${stdenv.libc}" 297 - --with-native-system-header-dir=/include 298 - ) 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 299 312 ''; 300 313 301 314 dontDisableStatic = true; ··· 462 475 ++ optionals javaAwtGtk [ gmp mpfr ] 463 476 ++ optional (libpthread != null) libpthread))); 464 477 465 - extraFlags = 466 - (if cross != null && libcCross != null 478 + EXTRA_TARGET_CFLAGS = 479 + if cross != null && libcCross != null 467 480 then "-idirafter ${libcCross}/include" 468 - else "") + optionalString stdenv.isDarwin " -F${CF}/Library/Frameworks"; 481 + else null; 469 482 470 483 EXTRA_TARGET_LDFLAGS = 471 484 if cross != null && libcCross != null
+2 -5
pkgs/development/compilers/gcc/builder.sh
··· 23 23 24 24 # Figure out what extra flags to pass to the gcc compilers 25 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 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)" 31 28 32 29 # Use *real* header files, otherwise a limits.h is generated 33 30 # that does not include Glibc's limits.h (notably missing
-6
pkgs/top-level/all-packages.nix
··· 3866 3866 libcCross = if crossSystem != null then libcCross else null; 3867 3867 3868 3868 isl = isl_0_14; 3869 - 3870 - inherit (darwin) CF; 3871 3869 })); 3872 3870 3873 3871 gcc49 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.9 { ··· 3885 3883 isl = isl_0_11; 3886 3884 3887 3885 cloog = cloog_0_18_0; 3888 - 3889 - inherit (darwin) CF; 3890 3886 })); 3891 3887 3892 3888 gcc5 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/5 { ··· 3902 3898 libcCross = if crossSystem != null then libcCross else null; 3903 3899 3904 3900 isl = isl_0_14; 3905 - 3906 - inherit (darwin) CF; 3907 3901 })); 3908 3902 3909 3903 gfortran = if !stdenv.isDarwin then gfortran49