gcc: Lock down more tools for cross-builds

That is, build != host == target
This commit is contained in:
John Ericson 2017-11-29 20:10:24 -05:00
parent 8f970d09fe
commit 2fdca4db69
7 changed files with 217 additions and 14 deletions

View file

@ -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 "";

View file

@ -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 "";

View file

@ -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 "";

View file

@ -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 "";

View file

@ -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 "";

View file

@ -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 "";

View file

@ -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 "";