diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2016-06-19 23:05:08 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2016-06-19 23:07:10 -0500 |
commit | f05bb6d23f2575374c8399a626aed36002302ff7 (patch) | |
tree | 288eefd2656c940ceb28ff963b9eebef5bb663cf /pkgs/development/compilers | |
parent | 20a8349d625814d6c7d9ad39f2b83a2a02e999f5 (diff) | |
download | nixlib-f05bb6d23f2575374c8399a626aed36002302ff7.tar nixlib-f05bb6d23f2575374c8399a626aed36002302ff7.tar.gz nixlib-f05bb6d23f2575374c8399a626aed36002302ff7.tar.bz2 nixlib-f05bb6d23f2575374c8399a626aed36002302ff7.tar.lz nixlib-f05bb6d23f2575374c8399a626aed36002302ff7.tar.xz nixlib-f05bb6d23f2575374c8399a626aed36002302ff7.tar.zst nixlib-f05bb6d23f2575374c8399a626aed36002302ff7.zip |
gcc: fix darwin building
- disable bootstrap builds on Darwin - remove xcrun calls - check if patchelf is available before using - apply darwin patch for gcc4.9 - fixes #16047 - fixes #14812
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r-- | pkgs/development/compilers/gcc/4.6/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/4.8/default.nix | 14 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/4.9/default.nix | 11 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/5/default.nix | 11 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/6/default.nix | 11 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/builder.sh | 28 |
6 files changed, 22 insertions, 55 deletions
diff --git a/pkgs/development/compilers/gcc/4.6/default.nix b/pkgs/development/compilers/gcc/4.6/default.nix index 7003f4335c8a..f912b4400f09 100644 --- a/pkgs/development/compilers/gcc/4.6/default.nix +++ b/pkgs/development/compilers/gcc/4.6/default.nix @@ -170,7 +170,7 @@ let version = "4.6.4"; "-stage-final"; crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else ""; - bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips; + bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips && !stdenv.isDarwin; in diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 6810b52574c6..3af123c677d0 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -70,7 +70,8 @@ let version = "4.8.5"; # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its # target libraries and tools. ++ optional langAda ../gnat-cflags.patch - ++ optional langFortran ../gfortran-driving.patch; + ++ optional langFortran ../gfortran-driving.patch + ++ optional stdenv.isDarwin ../gfortran-darwin-NXConstStr.patch; javaEcj = fetchurl { # The `$(top_srcdir)/ecj.jar' file is automatically picked up at @@ -197,7 +198,7 @@ let version = "4.8.5"; stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else ""; - bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips; + bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips && !stdenv.isDarwin; in @@ -304,15 +305,6 @@ stdenv.mkDerivation ({ export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_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" - '' + stdenv.lib.optionalString stdenv.isDarwin '' - if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then - configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include) - makeFlagsArray+=( \ - 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; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 195a7b03eed4..c0c3b77a1901 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -199,7 +199,7 @@ let version = "4.9.3"; stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else ""; - bootstrap = cross == null; + bootstrap = cross == null && !stdenv.isDarwin; in @@ -307,15 +307,6 @@ stdenv.mkDerivation ({ export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_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" - '' + stdenv.lib.optionalString stdenv.isDarwin '' - if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then - configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include) - makeFlagsArray+=( \ - 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 '' + stdenv.lib.optionalString (langJava || langGo) '' export lib=$out; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 9e0220ffc728..0e80a0da8e8d 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -198,7 +198,7 @@ let version = "5.3.0"; stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else ""; - bootstrap = cross == null; + bootstrap = cross == null && !stdenv.isDarwin; in @@ -306,15 +306,6 @@ stdenv.mkDerivation ({ export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_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" - '' + stdenv.lib.optionalString stdenv.isDarwin '' - if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then - configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include) - makeFlagsArray+=( \ - 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; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 6ca0f2f59f44..d7bcf8a26260 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -198,7 +198,7 @@ let version = "6.1.0"; stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else ""; - bootstrap = cross == null; + bootstrap = cross == null && !stdenv.isDarwin; in @@ -306,15 +306,6 @@ stdenv.mkDerivation ({ export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_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" - '' + stdenv.lib.optionalString stdenv.isDarwin '' - if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then - configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include) - makeFlagsArray+=( \ - 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; diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index 22107e72ef70..037ceae3d569 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -229,19 +229,21 @@ postInstall() { # More dependencies with the previous gcc or some libs (gccbug stores the build command line) rm -rf $out/bin/gccbug - # Take out the bootstrap-tools from the rpath, as it's not needed at all having $out - for i in $(find "$out"/libexec/gcc/*/*/* -type f -a \! -name '*.la'); do - PREV_RPATH=`patchelf --print-rpath "$i"` - NEW_RPATH=`echo "$PREV_RPATH" | sed 's,:[^:]*bootstrap-tools/lib,,g'` - patchelf --set-rpath "$NEW_RPATH" "$i" && echo OK - done - - # For some reason the libs retain RPATH to $out - for i in "$lib"/lib/{libtsan,libasan,libubsan}.so.*.*.*; do - PREV_RPATH=`patchelf --print-rpath "$i"` - NEW_RPATH=`echo "$PREV_RPATH" | sed "s,:${out}[^:]*,,g"` - patchelf --set-rpath "$NEW_RPATH" "$i" && echo OK - done + if type "patchelf"; then + # Take out the bootstrap-tools from the rpath, as it's not needed at all having $out + for i in $(find "$out"/libexec/gcc/*/*/* -type f -a \! -name '*.la'); do + PREV_RPATH=`patchelf --print-rpath "$i"` + NEW_RPATH=`echo "$PREV_RPATH" | sed 's,:[^:]*bootstrap-tools/lib,,g'` + patchelf --set-rpath "$NEW_RPATH" "$i" && echo OK + done + + # For some reason the libs retain RPATH to $out + for i in "$lib"/lib/{libtsan,libasan,libubsan}.so.*.*.*; do + PREV_RPATH=`patchelf --print-rpath "$i"` + NEW_RPATH=`echo "$PREV_RPATH" | sed "s,:${out}[^:]*,,g"` + patchelf --set-rpath "$NEW_RPATH" "$i" && echo OK + done + fi # Get rid of some "fixed" header files rm -rfv $out/lib/gcc/*/*/include-fixed/{root,linux} |