From 2afd3c901e4d1038ae0ba93bd3765002b997e815 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sun, 15 Apr 2018 00:00:00 +0000 Subject: [PATCH 1/3] gcc: prepend `crossNameAddon` instead of appending it (like binutils does) --- pkgs/development/compilers/gcc/4.8/default.nix | 4 ++-- pkgs/development/compilers/gcc/4.9/default.nix | 4 ++-- pkgs/development/compilers/gcc/5/default.nix | 4 ++-- pkgs/development/compilers/gcc/6/default.nix | 4 ++-- pkgs/development/compilers/gcc/7/default.nix | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 0a6ea59e5ac..ff2fb0d7ff0 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -170,7 +170,7 @@ let version = "4.8.5"; "--disable-decimal-float" # No final libdecnumber (it may work only in 386) ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; + crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else ""; bootstrap = targetPlatform == hostPlatform; @@ -180,7 +180,7 @@ in assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == []; stdenv.mkDerivation ({ - name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon; + name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; builder = ../builder.sh; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 5dfdbd02cbf..d0729e78e48 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -164,7 +164,7 @@ let version = "4.9.4"; "--disable-decimal-float" # No final libdecnumber (it may work only in 386) ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; + crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else ""; bootstrap = targetPlatform == hostPlatform; @@ -174,7 +174,7 @@ in assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == []; stdenv.mkDerivation ({ - name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon; + name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; builder = ../builder.sh; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index e42bb736676..2990ea1cd4a 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -168,7 +168,7 @@ let version = "5.5.0"; "--disable-decimal-float" # No final libdecnumber (it may work only in 386) ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; + crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else ""; bootstrap = targetPlatform == hostPlatform; @@ -178,7 +178,7 @@ in assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == []; stdenv.mkDerivation ({ - name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon; + name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; builder = ../builder.sh; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index cf71f51627c..f8708495c82 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -167,7 +167,7 @@ let version = "6.4.0"; "--disable-decimal-float" # No final libdecnumber (it may work only in 386) ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; + crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else ""; bootstrap = targetPlatform == hostPlatform; @@ -177,7 +177,7 @@ in assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == []; stdenv.mkDerivation ({ - name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon; + name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; builder = ../builder.sh; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 0b19aa95eff..74210bdcb6d 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -172,7 +172,7 @@ let version = "7.3.0"; "--disable-decimal-float" # No final libdecnumber (it may work only in 386) ])); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; + crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else ""; bootstrap = targetPlatform == hostPlatform; @@ -182,7 +182,7 @@ in assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == []; stdenv.mkDerivation ({ - name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon; + name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; builder = ../builder.sh; From 82dd4501f405800202b0485c1bab5575f30be80a Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sun, 15 Apr 2018 00:00:01 +0000 Subject: [PATCH 2/3] bintools-wrapper, cc-wrapper: don't add `targetPrefix` the second time ... binutils and gcc add it already anyway. Without this it's easy to get cross-toolchain paths longer than 256 chars and nix-daemon will then fail to commit them to /nix/store on XFS. --- pkgs/build-support/bintools-wrapper/default.nix | 2 +- pkgs/build-support/cc-wrapper/default.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 5c0436b73dd..a4e2ecb63b8 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -74,7 +74,7 @@ in stdenv.mkDerivation { name = targetPrefix - + (if name != "" then name else "${bintoolsName}-wrapper") + + (if name != "" then name else stdenv.lib.removePrefix targetPrefix "${bintoolsName}-wrapper") + (stdenv.lib.optionalString (bintools != null && bintoolsVersion != "") "-${bintoolsVersion}"); preferLocalBuild = true; diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 43cd87fb459..700e7547b7a 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -71,7 +71,7 @@ assert nativePrefix == bintools.nativePrefix; stdenv.mkDerivation { name = targetPrefix - + (if name != "" then name else "${ccName}-wrapper") + + (if name != "" then name else stdenv.lib.removePrefix targetPrefix "${ccName}-wrapper") + (stdenv.lib.optionalString (cc != null && ccVersion != "") "-${ccVersion}"); preferLocalBuild = true; From 43dbc268cbe74b68e504a0a03087514cbd2f2cdf Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Thu, 26 Apr 2018 14:50:36 +0000 Subject: [PATCH 3/3] gccCrossStageStatic: don't override name --- pkgs/top-level/all-packages.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 79d42d12c82..77450f1fe84 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6128,7 +6128,6 @@ with pkgs; libc = libcCross1; }; in wrapCCWith { - name = "gcc-cross-wrapper"; cc = gccFun { # copy-pasted inherit noSysDirs;