diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 532c56d5257..8aeb531e3eb 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -25,7 +25,8 @@ , libcCross ? null , crossStageStatic ? false , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd -, stripped ? true +, # Strip kills static libs of other archs (hence no cross) + stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform , gnused ? null , darwin ? null , buildPlatform, hostPlatform, targetPlatform @@ -371,21 +372,17 @@ stdenv.mkDerivation ({ targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; - buildFlags = if bootstrap then - (if profiledCompiler then "profiledbootstrap" else "bootstrap") - else ""; + buildFlags = optional + (bootstrap && hostPlatform == buildPlatform) + (if profiledCompiler then "profiledbootstrap" else "bootstrap"); + + dontStrip = !stripped; installTargets = if stripped then "install-strip" else "install"; - /* For cross-built gcc (build != host == target) */ - crossAttrs = { - dontStrip = true; - buildFlags = ""; - }; - # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; @@ -487,8 +484,5 @@ stdenv.mkDerivation ({ installTargets = "install-gcc install-target-libgcc"; } -# Strip kills static libs of other archs (hence targetPlatform != hostPlatform) -// optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; } - // optionalAttrs (enableMultilib) { dontMoveLib64 = true; } ) diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index f041252495a..7bd9f5460f1 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -25,7 +25,8 @@ , libcCross ? null , crossStageStatic ? false , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd -, stripped ? true +, # Strip kills static libs of other archs (hence no cross) + stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform , gnused ? null , darwin ? null , buildPlatform, hostPlatform, targetPlatform @@ -393,21 +394,17 @@ stdenv.mkDerivation ({ targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; - buildFlags = if bootstrap then - (if profiledCompiler then "profiledbootstrap" else "bootstrap") - else ""; + buildFlags = optional + (bootstrap && hostPlatform == buildPlatform) + (if profiledCompiler then "profiledbootstrap" else "bootstrap"); + + dontStrip = !stripped; installTargets = if stripped then "install-strip" else "install"; - /* For cross-built gcc (build != host == target) */ - crossAttrs = { - dontStrip = true; - buildFlags = ""; - }; - # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; @@ -505,9 +502,6 @@ stdenv.mkDerivation ({ installTargets = "install-gcc install-target-libgcc"; } -# Strip kills static libs of other archs (hence targetPlatform != hostPlatform) -// optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; } - // optionalAttrs (enableMultilib) { dontMoveLib64 = true; } // optionalAttrs (langJava) { diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index dee798eb09b..b61a3719cc6 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -25,7 +25,8 @@ , libcCross ? null , crossStageStatic ? false , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd -, stripped ? true +, # Strip kills static libs of other archs (hence no cross) + stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform , gnused ? null , cloog # unused; just for compat with gcc4, as we override the parameter on some places , darwin ? null @@ -396,21 +397,17 @@ stdenv.mkDerivation ({ targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; - buildFlags = if bootstrap then - (if profiledCompiler then "profiledbootstrap" else "bootstrap") - else ""; + buildFlags = optional + (bootstrap && hostPlatform == buildPlatform) + (if profiledCompiler then "profiledbootstrap" else "bootstrap"); + + dontStrip = !stripped; installTargets = if stripped then "install-strip" else "install"; - /* For cross-built gcc (build != host == target) */ - crossAttrs = { - dontStrip = true; - buildFlags = ""; - }; - # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; @@ -508,8 +505,5 @@ stdenv.mkDerivation ({ installTargets = "install-gcc install-target-libgcc"; } -# Strip kills static libs of other archs (hence targetPlatform != hostPlatform) -// optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; } - // optionalAttrs (enableMultilib) { dontMoveLib64 = true; } ) diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index b99ab8fce7f..9a26d4dae26 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -25,7 +25,8 @@ , libcCross ? null , crossStageStatic ? false , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd -, stripped ? true +, # Strip kills static libs of other archs (hence no cross) + stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform , gnused ? null , cloog # unused; just for compat with gcc4, as we override the parameter on some places , darwin ? null @@ -400,20 +401,17 @@ stdenv.mkDerivation ({ targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; - buildFlags = - optional bootstrap (if profiledCompiler then "profiledbootstrap" else "bootstrap"); + buildFlags = optional + (bootstrap && hostPlatform == buildPlatform) + (if profiledCompiler then "profiledbootstrap" else "bootstrap"); + + dontStrip = !stripped; installTargets = if stripped then "install-strip" else "install"; - /* For cross-built gcc (build != host == target) */ - crossAttrs = { - dontStrip = true; - buildFlags = ""; - }; - # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; @@ -511,9 +509,6 @@ stdenv.mkDerivation ({ installTargets = "install-gcc install-target-libgcc"; } -# Strip kills static libs of other archs (hence targetPlatform != hostPlatform) -// optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; } - // optionalAttrs (enableMultilib) { dontMoveLib64 = true; } // optionalAttrs (langJava) { diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 493e50d9f32..dd5e42f7642 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -25,7 +25,8 @@ , libcCross ? null , crossStageStatic ? false , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd -, stripped ? true +, # Strip kills static libs of other archs (hence no cross) + stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform , gnused ? null , cloog # unused; just for compat with gcc4, as we override the parameter on some places , darwin ? null @@ -406,20 +407,17 @@ stdenv.mkDerivation ({ targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; - buildFlags = - optional bootstrap (if profiledCompiler then "profiledbootstrap" else "bootstrap"); + buildFlags = optional + (bootstrap && hostPlatform == buildPlatform) + (if profiledCompiler then "profiledbootstrap" else "bootstrap"); + + dontStrip = !stripped; installTargets = if stripped then "install-strip" else "install"; - /* For cross-built gcc (build != host == target) */ - crossAttrs = { - dontStrip = true; - buildFlags = ""; - }; - # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; @@ -517,8 +515,5 @@ stdenv.mkDerivation ({ installTargets = "install-gcc install-target-libgcc"; } -# Strip kills static libs of other archs (hence targetPlatform != hostPlatform) -// optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; } - // optionalAttrs (enableMultilib) { dontMoveLib64 = true; } ) diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 2465e6149c0..239735bc657 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -18,7 +18,8 @@ , libcCross ? null , crossStageStatic ? false , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd -, stripped ? true +, # Strip kills static libs of other archs (hence no cross) + stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform , gnused ? null , cloog # unused; just for compat with gcc4, as we override the parameter on some places , darwin ? null @@ -347,20 +348,17 @@ stdenv.mkDerivation ({ targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; - buildFlags = - optional bootstrap (if profiledCompiler then "profiledbootstrap" else "bootstrap"); + buildFlags = optional + (bootstrap && hostPlatform == buildPlatform) + (if profiledCompiler then "profiledbootstrap" else "bootstrap"); + + dontStrip = !stripped; installTargets = if stripped then "install-strip" else "install"; - /* For cross-built gcc (build != host == target) */ - crossAttrs = { - dontStrip = true; - buildFlags = ""; - }; - # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; @@ -447,8 +445,5 @@ stdenv.mkDerivation ({ installTargets = "install-gcc install-target-libgcc"; } -# Strip kills static libs of other archs (hence targetPlatform != hostPlatform) -// optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; } - // optionalAttrs (enableMultilib) { dontMoveLib64 = true; } ) diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index d37cfac3fa8..d87df997289 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -25,7 +25,8 @@ , libcCross ? null , crossStageStatic ? false , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd -, stripped ? true +, # Strip kills static libs of other archs (hence no cross) + stripped ? hostPlatform == buildPlatform && targetPlatform == hostPlatform , gnused ? null , cloog # unused; just for compat with gcc4, as we override the parameter on some places , darwin ? null @@ -371,17 +372,14 @@ stdenv.mkDerivation ({ (if profiledCompiler then "profiledbootstrap" else "bootstrap") else ""; + dontStrip = !stripped; + NIX_STRIP_DEBUG = !stripped; + installTargets = if stripped then "install-strip" else "install"; - /* For cross-built gcc (build != host == target) */ - crossAttrs = { - dontStrip = true; - buildFlags = ""; - }; - # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210 ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64"; @@ -481,8 +479,5 @@ stdenv.mkDerivation ({ installTargets = "install-gcc install-target-libgcc"; } -# Strip kills static libs of other archs (hence targetPlatform != hostPlatform) -// optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; NIX_STRIP_DEBUG = 0; } - // optionalAttrs (enableMultilib) { dontMoveLib64 = true; } )