Skip to content

Commit

Permalink
gcc: Get rid of crossAttrs
Browse files Browse the repository at this point in the history
Only a little bit was left
  • Loading branch information
Ericson2314 committed May 10, 2018
1 parent 1e966f9 commit c42118b
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 85 deletions.
20 changes: 7 additions & 13 deletions pkgs/development/compilers/gcc/4.8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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";

Expand Down Expand Up @@ -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; }
)
20 changes: 7 additions & 13 deletions pkgs/development/compilers/gcc/4.9/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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";

Expand Down Expand Up @@ -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) {
Expand Down
20 changes: 7 additions & 13 deletions pkgs/development/compilers/gcc/5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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";

Expand Down Expand Up @@ -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; }
)
19 changes: 7 additions & 12 deletions pkgs/development/compilers/gcc/6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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";

Expand Down Expand Up @@ -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) {
Expand Down
19 changes: 7 additions & 12 deletions pkgs/development/compilers/gcc/7/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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";

Expand Down Expand Up @@ -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; }
)
19 changes: 7 additions & 12 deletions pkgs/development/compilers/gcc/8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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";

Expand Down Expand Up @@ -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; }
)
15 changes: 5 additions & 10 deletions pkgs/development/compilers/gcc/snapshot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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";

Expand Down Expand Up @@ -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; }
)

0 comments on commit c42118b

Please sign in to comment.