From 2fdca4db69c845771968a4976e19d05a52975ed8 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 29 Nov 2017 20:10:24 -0500 Subject: [PATCH] gcc: Lock down more tools for cross-builds That is, build != host == target --- .../development/compilers/gcc/4.5/default.nix | 33 +++++++++++++++++-- .../development/compilers/gcc/4.8/default.nix | 33 +++++++++++++++++-- .../development/compilers/gcc/4.9/default.nix | 33 +++++++++++++++++-- pkgs/development/compilers/gcc/5/default.nix | 33 +++++++++++++++++-- pkgs/development/compilers/gcc/6/default.nix | 33 +++++++++++++++++-- pkgs/development/compilers/gcc/7/default.nix | 33 +++++++++++++++++-- .../compilers/gcc/snapshot/default.nix | 33 +++++++++++++++++-- 7 files changed, 217 insertions(+), 14 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index 67981ad1056e..114fc4d8307c 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -273,14 +273,43 @@ stdenv.mkDerivation ({ targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; crossAttrs = { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index de9d3165b55e..1a1400a57a80 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -391,14 +391,43 @@ stdenv.mkDerivation ({ xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index c5bebdf33003..8842be6a49ba 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -397,14 +397,43 @@ stdenv.mkDerivation ({ xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index b4a74300d366..38bc0dff4b46 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -412,14 +412,43 @@ stdenv.mkDerivation ({ xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 057acf9794e7..1d77a9b4a008 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -394,14 +394,43 @@ stdenv.mkDerivation ({ xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 5d3126ea0e96..c411a546f596 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -395,14 +395,43 @@ stdenv.mkDerivation ({ xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, targetPlatform != hostPlatform NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else ""; diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index bb2c9d8a5c09..ecd0c73d347f 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -395,14 +395,43 @@ stdenv.mkDerivation ({ xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else ""; xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else ""; in { + AR_FOR_BUILD = "ar"; + AS_FOR_BUILD = "as"; + LD_FOR_BUILD = "ld"; + NM_FOR_BUILD = "nm"; + OBJCOPY_FOR_BUILD = "objcopy"; + OBJDUMP_FOR_BUILD = "objdump"; + RANLIB_FOR_BUILD = "ranlib"; + SIZE_FOR_BUILD = "size"; + STRINGS_FOR_BUILD = "strings"; + STRIP_FOR_BUILD = "strip"; + CC_FOR_BUILD = "gcc"; + CXX_FOR_BUILD = "g++"; + AR = "${targetPlatform.config}-ar"; + AS = "${targetPlatform.config}-as"; LD = "${targetPlatform.config}-ld"; + NM = "${targetPlatform.config}-nm"; + OBJCOPY = "${targetPlatform.config}-objcopy"; + OBJDUMP = "${targetPlatform.config}-objdump"; + RANLIB = "${targetPlatform.config}-ranlib"; + SIZE = "${targetPlatform.config}-size"; + STRINGS = "${targetPlatform.config}-strings"; + STRIP = "${targetPlatform.config}-strip"; CC = "${targetPlatform.config}-gcc"; - CXX = "${targetPlatform.config}-gcc"; + CXX = "${targetPlatform.config}-g++"; + AR_FOR_TARGET = "${targetPlatform.config}-ar"; + AS_FOR_TARGET = "${targetPlatform.config}-as"; LD_FOR_TARGET = "${targetPlatform.config}-ld"; - CC_FOR_TARGET = "${targetPlatform.config}-gcc"; NM_FOR_TARGET = "${targetPlatform.config}-nm"; + OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy"; + OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump"; + RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib"; + SIZE_FOR_TARGET = "${targetPlatform.config}-size"; + STRINGS_FOR_TARGET = "${targetPlatform.config}-strings"; + STRIP_FOR_TARGET = "${targetPlatform.config}-strip"; + CC_FOR_TARGET = "${targetPlatform.config}-gcc"; CXX_FOR_TARGET = "${targetPlatform.config}-g++"; # If we are making a cross compiler, cross != null NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";