add darwin gcc fixes to gcc 5

This commit is contained in:
Jude Taylor 2015-08-02 14:38:20 -07:00
parent f6f8c402ca
commit ebda45e6b9
2 changed files with 12 additions and 23 deletions
pkgs
development/compilers/gcc/5
top-level

View File

@ -32,8 +32,7 @@
, gnat ? null , gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true , stripped ? true
, gnused ? null , CF ? null
, binutils ? null
}: }:
assert langJava -> zip != null && unzip != null assert langJava -> zip != null && unzip != null
@ -45,11 +44,8 @@ assert langVhdl -> gnat != null;
# LTO needs libelf and zlib. # LTO needs libelf and zlib.
assert libelf != null -> zlib != null; assert libelf != null -> zlib != null;
# Make sure we get GNU sed. # Make sure we get CoreFoundation.
assert stdenv.isDarwin -> gnused != null; assert stdenv.isDarwin -> CF != null;
# Need c++filt on darwin
assert stdenv.isDarwin -> binutils != null;
# The go frontend is written in c++ # The go frontend is written in c++
assert langGo -> langCC; assert langGo -> langCC;
@ -286,11 +282,6 @@ stdenv.mkDerivation ({
++ (optionals (cross != null) [binutilsCross]) ++ (optionals (cross != null) [binutilsCross])
++ (optionals langAda [gnatboot]) ++ (optionals langAda [gnatboot])
++ (optionals langVhdl [gnat]) ++ (optionals langVhdl [gnat])
# The builder relies on GNU sed (for instance, Darwin's `sed' fails with
# "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
++ (optional stdenv.isDarwin gnused)
++ (optional stdenv.isDarwin binutils)
; ;
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl"; NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl";
@ -301,14 +292,10 @@ stdenv.mkDerivation ({
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET" export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET" export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
'' + stdenv.lib.optionalString stdenv.isDarwin '' '' + stdenv.lib.optionalString stdenv.isDarwin ''
if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then configureFlagsArray+=(
configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include) --with-sysroot="${stdenv.libc}"
makeFlagsArray+=( \ --with-native-system-header-dir=/include
CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \ )
CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
)
fi
''; '';
dontDisableStatic = true; dontDisableStatic = true;
@ -475,10 +462,10 @@ stdenv.mkDerivation ({
++ optionals javaAwtGtk [ gmp mpfr ] ++ optionals javaAwtGtk [ gmp mpfr ]
++ optional (libpthread != null) libpthread))); ++ optional (libpthread != null) libpthread)));
EXTRA_TARGET_CFLAGS = extraFlags =
if cross != null && libcCross != null (if cross != null && libcCross != null
then "-idirafter ${libcCross}/include" then "-idirafter ${libcCross}/include"
else null; else "") + optionalString stdenv.isDarwin " -F${CF}/Library/Frameworks";
EXTRA_TARGET_LDFLAGS = EXTRA_TARGET_LDFLAGS =
if cross != null && libcCross != null if cross != null && libcCross != null

View File

@ -3868,6 +3868,8 @@ let
libcCross = if crossSystem != null then libcCross else null; libcCross = if crossSystem != null then libcCross else null;
isl = isl_0_14; isl = isl_0_14;
inherit (darwin) CF;
})); }));
gfortran = if !stdenv.isDarwin then gfortran49 gfortran = if !stdenv.isDarwin then gfortran49