From 1080e264fb19f55e5c20edb0fad744ff2366c3dc Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 10 May 2018 13:46:38 -0400 Subject: [PATCH 1/7] groff: Get rid of crossAttrs --- pkgs/tools/text/groff/default.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix index 4495a85b2885..27581134ca34 100644 --- a/pkgs/tools/text/groff/default.nix +++ b/pkgs/tools/text/groff/default.nix @@ -50,15 +50,14 @@ stdenv.mkDerivation rec { "ac_cv_path_PERL=${buildPackages.perl}/bin/perl" ]; - doCheck = true; - - crossAttrs = { + makeFlags = stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ # Trick to get the build system find the proper 'native' groff # http://www.mail-archive.com/bug-groff@gnu.org/msg01335.html - preBuild = '' - makeFlags="GROFF_BIN_PATH=${buildPackages.groff}/bin GROFFBIN=${buildPackages.groff}/bin/groff" - ''; - }; + "GROFF_BIN_PATH=${buildPackages.groff}/bin" + "GROFFBIN=${buildPackages.groff}/bin/groff" + ]; + + doCheck = true; # Remove example output with (random?) colors and creation date # to avoid non-determinism in the output. From 48300199566229bd1409eb8f1f2cf8b8871d6b67 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 10 May 2018 12:55:36 -0400 Subject: [PATCH 2/7] libpcap: Remove crossAttrs --- .../development/libraries/libpcap/default.nix | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/libpcap/default.nix b/pkgs/development/libraries/libpcap/default.nix index bef5f9a9da34..945554386930 100644 --- a/pkgs/development/libraries/libpcap/default.nix +++ b/pkgs/development/libraries/libpcap/default.nix @@ -12,10 +12,16 @@ stdenv.mkDerivation rec { # We need to force the autodetection because detection doesn't # work in pure build enviroments. - configureFlags = - if stdenv.isLinux then [ "--with-pcap=linux" ] - else if stdenv.isDarwin then [ "--with-pcap=bpf" ] - else []; + configureFlags = [ + ("--with-pcap=" + { + linux = "linux"; + darwin = "bpf"; + }.${stdenv.hostPlatform.parsed.kernel.name}) + ] ++ stdenv.lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ + "ac_cv_linux_vers=2" + ]; + + dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; prePatch = stdenv.lib.optionalString stdenv.isDarwin '' substituteInPlace configure --replace " -arch i386" "" @@ -39,12 +45,6 @@ stdenv.mkDerivation rec { preInstall = ''mkdir -p $out/bin''; - crossAttrs = { - # Stripping hurts in static libraries - dontStrip = true; - configureFlags = configureFlags ++ [ "ac_cv_linux_vers=2" ]; - }; - meta = with stdenv.lib; { homepage = http://www.tcpdump.org; description = "Packet Capture Library"; From d1cf0a8a3ad50f6e34f0cef7aee914552c1127ec Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 10 May 2018 14:17:24 -0400 Subject: [PATCH 3/7] tcpdump: Remove crossAttrs and obsolete options --- pkgs/tools/networking/tcpdump/default.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/networking/tcpdump/default.nix b/pkgs/tools/networking/tcpdump/default.nix index 324a58cf7edb..59cc89ac5727 100644 --- a/pkgs/tools/networking/tcpdump/default.nix +++ b/pkgs/tools/networking/tcpdump/default.nix @@ -1,6 +1,4 @@ -{ stdenv, fetchurl, fetchpatch, libpcap, enableStatic ? false -, hostPlatform -}: +{ stdenv, fetchurl, fetchpatch, libpcap }: stdenv.mkDerivation rec { name = "tcpdump-${version}"; @@ -20,11 +18,9 @@ stdenv.mkDerivation rec { buildInputs = [ libpcap ]; - crossAttrs = { - LDFLAGS = if enableStatic then "-static" else ""; - configureFlags = [ "ac_cv_linux_vers=2" ] ++ (stdenv.lib.optional - (hostPlatform.platform.kernelMajor or null == "2.4") "--disable-ipv6"); - }; + configureFlags = stdenv.lib.optional + (stdenv.hostPlatform != stdenv.buildPlatform) + "ac_cv_linux_vers=2"; meta = { description = "Network sniffer"; From 507a64cd8da1647cd801ab01e1b95b4d6b43842e Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 10 May 2018 12:42:43 -0400 Subject: [PATCH 4/7] libmsgpack: Remove crossAttrs Just set cmakeFlags directly. Also improve conditions. --- pkgs/development/libraries/libmsgpack/generic.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/libmsgpack/generic.nix b/pkgs/development/libraries/libmsgpack/generic.nix index 889ef1347732..947960d23592 100644 --- a/pkgs/development/libraries/libmsgpack/generic.nix +++ b/pkgs/development/libraries/libmsgpack/generic.nix @@ -13,13 +13,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - crossAttrs = { - } // stdenv.lib.optionalAttrs (hostPlatform.libc == "msvcrt") { - cmakeFlags = [ - "-DMSGPACK_BUILD_EXAMPLES=OFF" - "-DCMAKE_SYSTEM_NAME=Windows" - ]; - }; + cmakeFlags = [] + ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + "-DMSGPACK_BUILD_EXAMPLES=OFF" + ++ stdenv.lib.optional (hostPlatform.libc == "msvcrt") + "-DCMAKE_SYSTEM_NAME=Windows" + ; meta = with stdenv.lib; { description = "MessagePack implementation for C and C++"; From 01b274ce0d9923eb960b1a55e13527545f381f41 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 10 May 2018 13:08:07 -0400 Subject: [PATCH 5/7] librsync: Remove crossAttrs --- pkgs/development/libraries/librsync/0.9.nix | 4 +--- pkgs/development/libraries/librsync/default.nix | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/librsync/0.9.nix b/pkgs/development/libraries/librsync/0.9.nix index 0954694cf290..115f4cd90a0c 100644 --- a/pkgs/development/libraries/librsync/0.9.nix +++ b/pkgs/development/libraries/librsync/0.9.nix @@ -12,9 +12,7 @@ stdenv.mkDerivation { configureFlags = if stdenv.isCygwin then "--enable-static" else "--enable-shared"; - crossAttrs = { - dontStrip = true; - }; + dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; meta = { homepage = http://librsync.sourceforge.net/; diff --git a/pkgs/development/libraries/librsync/default.nix b/pkgs/development/libraries/librsync/default.nix index 80acaf57d625..afb83051b211 100644 --- a/pkgs/development/libraries/librsync/default.nix +++ b/pkgs/development/libraries/librsync/default.nix @@ -14,9 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ perl zlib bzip2 popt ]; - crossAttrs = { - dontStrip = true; - }; + dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; meta = with stdenv.lib; { homepage = http://librsync.sourceforge.net/; From 1e966f9aa6684c7a19493bbb470aafffce399dd9 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 10 May 2018 13:43:12 -0400 Subject: [PATCH 6/7] libvpx: Get rid of crossAttrs Only breaks native hashes because configurePlatforms --- pkgs/development/libraries/libvpx/default.nix | 52 +++++++++---------- pkgs/development/libraries/libvpx/git.nix | 34 ++++++------ 2 files changed, 39 insertions(+), 47 deletions(-) diff --git a/pkgs/development/libraries/libvpx/default.nix b/pkgs/development/libraries/libvpx/default.nix index 272761cc6af3..011e1450d474 100644 --- a/pkgs/development/libraries/libvpx/default.nix +++ b/pkgs/development/libraries/libvpx/default.nix @@ -72,6 +72,7 @@ stdenv.mkDerivation rec { outputs = [ "bin" "dev" "out" ]; setOutputFlags = false; + configurePlatforms = []; configureFlags = [ (enableFeature (vp8EncoderSupport || vp8DecoderSupport) "vp8") (enableFeature vp8EncoderSupport "vp8-encoder") @@ -131,8 +132,29 @@ stdenv.mkDerivation rec { (enableFeature (experimentalSpatialSvcSupport || experimentalFpMbStatsSupport || experimentalEmulateHardwareSupport) "experimental") - # Experimental features - ] ++ optional experimentalSpatialSvcSupport "--enable-spatial-svc" + ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + #"--extra-cflags=" + #"--extra-cxxflags=" + #"--prefix=" + #"--libc=" + #"--libdir=" + "--enable-external-build" + # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version) + # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure + # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14 + "--force-target=${hostPlatform.config}${ + if hostPlatform.isDarwin then + if hostPlatform.osxMinVersion == "10.10" then "14" + else if hostPlatform.osxMinVersion == "10.9" then "13" + else if hostPlatform.osxMinVersion == "10.8" then "12" + else if hostPlatform.osxMinVersion == "10.7" then "11" + else if hostPlatform.osxMinVersion == "10.6" then "10" + else if hostPlatform.osxMinVersion == "10.5" then "9" + else "8" + else ""}-gcc" + (if hostPlatform.isCygwin then "--enable-static-msvcrt" else "") + ] # Experimental features + ++ optional experimentalSpatialSvcSupport "--enable-spatial-svc" ++ optional experimentalFpMbStatsSupport "--enable-fp-mb-stats" ++ optional experimentalEmulateHardwareSupport "--enable-emulate-hardware"; @@ -145,32 +167,6 @@ stdenv.mkDerivation rec { postInstall = ''moveToOutput bin "$bin" ''; - crossAttrs = { - configurePlatforms = []; - configureFlags = configureFlags ++ [ - #"--extra-cflags=" - #"--extra-cxxflags=" - #"--prefix=" - #"--libc=" - #"--libdir=" - "--enable-external-build" - # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version) - # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure - # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14 - "--force-target=${hostPlatform.config}${ - if hostPlatform.isDarwin then - if hostPlatform.osxMinVersion == "10.10" then "14" - else if hostPlatform.osxMinVersion == "10.9" then "13" - else if hostPlatform.osxMinVersion == "10.8" then "12" - else if hostPlatform.osxMinVersion == "10.7" then "11" - else if hostPlatform.osxMinVersion == "10.6" then "10" - else if hostPlatform.osxMinVersion == "10.5" then "9" - else "8" - else ""}-gcc" - (if hostPlatform.isCygwin then "--enable-static-msvcrt" else "") - ]; - }; - meta = with stdenv.lib; { description = "WebM VP8/VP9 codec SDK"; homepage = https://www.webmproject.org/; diff --git a/pkgs/development/libraries/libvpx/git.nix b/pkgs/development/libraries/libvpx/git.nix index e2b94dda28e7..7d4b75d6cdf8 100644 --- a/pkgs/development/libraries/libvpx/git.nix +++ b/pkgs/development/libraries/libvpx/git.nix @@ -77,6 +77,7 @@ stdenv.mkDerivation rec { outputs = [ "bin" "dev" "out" ]; setOutputFlags = false; + configurePlatforms = []; configureFlags = [ (enableFeature (vp8EncoderSupport || vp8DecoderSupport) "vp8") (enableFeature vp8EncoderSupport "vp8-encoder") @@ -139,23 +140,7 @@ stdenv.mkDerivation rec { (enableFeature (experimentalSpatialSvcSupport || experimentalFpMbStatsSupport || experimentalEmulateHardwareSupport) "experimental") - # Experimental features - ] ++ optional experimentalSpatialSvcSupport "--enable-spatial-svc" - ++ optional experimentalFpMbStatsSupport "--enable-fp-mb-stats" - ++ optional experimentalEmulateHardwareSupport "--enable-emulate-hardware"; - - nativeBuildInputs = [ perl yasm ]; - - buildInputs = [ ] - ++ optionals unitTestsSupport [ coreutils curl ]; - - enableParallelBuilding = true; - - postInstall = ''moveToOutput bin "$bin" ''; - - crossAttrs = { - configurePlatforms = []; - configureFlags = configureFlags ++ [ + ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ #"--extra-cflags=" #"--prefix=" #"--libc=" @@ -175,8 +160,19 @@ stdenv.mkDerivation rec { else "8" else ""}-gcc" (if hostPlatform.isCygwin then "--enable-static-msvcrt" else "") - ]; - }; + ] # Experimental features + ++ optional experimentalSpatialSvcSupport "--enable-spatial-svc" + ++ optional experimentalFpMbStatsSupport "--enable-fp-mb-stats" + ++ optional experimentalEmulateHardwareSupport "--enable-emulate-hardware"; + + nativeBuildInputs = [ perl yasm ]; + + buildInputs = [ ] + ++ optionals unitTestsSupport [ coreutils curl ]; + + enableParallelBuilding = true; + + postInstall = ''moveToOutput bin "$bin" ''; meta = with stdenv.lib; { description = "WebM VP8/VP9 codec SDK"; From c42118bb822ae35431343109aeb903f2c2d121af Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 10 May 2018 11:56:52 -0400 Subject: [PATCH 7/7] gcc: Get rid of crossAttrs Only a little bit was left --- .../development/compilers/gcc/4.8/default.nix | 20 +++++++------------ .../development/compilers/gcc/4.9/default.nix | 20 +++++++------------ pkgs/development/compilers/gcc/5/default.nix | 20 +++++++------------ pkgs/development/compilers/gcc/6/default.nix | 19 +++++++----------- pkgs/development/compilers/gcc/7/default.nix | 19 +++++++----------- pkgs/development/compilers/gcc/8/default.nix | 19 +++++++----------- .../compilers/gcc/snapshot/default.nix | 15 +++++--------- 7 files changed, 47 insertions(+), 85 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 532c56d52573..8aeb531e3ebe 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 f041252495a6..7bd9f5460f12 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 dee798eb09b1..b61a3719cc69 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 b99ab8fce7fb..9a26d4dae26a 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 493e50d9f327..dd5e42f7642e 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 2465e6149c0a..239735bc6574 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 d37cfac3fa85..d87df9972891 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; } )