From 37fe1613cfd9bb3e7031d60b1b7316fee090b00e Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 13 Feb 2023 01:19:59 -0800 Subject: [PATCH] gcc: expose --disable-bootstrap as disableBootstrap --- pkgs/development/compilers/gcc/11/default.nix | 2 ++ pkgs/development/compilers/gcc/12/default.nix | 2 ++ pkgs/development/compilers/gcc/common/configure-flags.nix | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix index 1c6b7326c0746..a7874377ce2d4 100644 --- a/pkgs/development/compilers/gcc/11/default.nix +++ b/pkgs/development/compilers/gcc/11/default.nix @@ -48,6 +48,7 @@ with builtins; let majorVersion = "11"; version = "${majorVersion}.3.0"; + disableBootstrap = !(with stdenv; targetPlatform == hostPlatform && hostPlatform == buildPlatform); inherit (stdenv) buildPlatform hostPlatform targetPlatform; @@ -115,6 +116,7 @@ let majorVersion = "11"; enableMultilib enablePlugin enableShared + disableBootstrap fetchpatch fetchurl gettext diff --git a/pkgs/development/compilers/gcc/12/default.nix b/pkgs/development/compilers/gcc/12/default.nix index f0bdafd8c208f..3f0279ef18587 100644 --- a/pkgs/development/compilers/gcc/12/default.nix +++ b/pkgs/development/compilers/gcc/12/default.nix @@ -53,6 +53,7 @@ with builtins; let majorVersion = "12"; version = "${majorVersion}.2.0"; + disableBootstrap = !(with stdenv; targetPlatform == hostPlatform && hostPlatform == buildPlatform); inherit (stdenv) buildPlatform hostPlatform targetPlatform; @@ -142,6 +143,7 @@ let majorVersion = "12"; buildPackages cloog crossStageStatic + disableBootstrap enableLTO enableMultilib enablePlugin diff --git a/pkgs/development/compilers/gcc/common/configure-flags.nix b/pkgs/development/compilers/gcc/common/configure-flags.nix index 78d13cb941e3c..e3a4aa7cccdff 100644 --- a/pkgs/development/compilers/gcc/common/configure-flags.nix +++ b/pkgs/development/compilers/gcc/common/configure-flags.nix @@ -23,6 +23,7 @@ , langObjC , langObjCpp , langJit +, disableBootstrap ? stdenv.targetPlatform != stdenv.hostPlatform }: assert langJava -> lib.versionOlder version "7"; @@ -214,7 +215,7 @@ let # TODO: aarch64-darwin has clang stdenv and its arch and cpu flag values are incompatible with gcc ++ lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) (import ../common/platform-flags.nix { inherit (stdenv) targetPlatform; inherit lib; }) ++ lib.optionals (targetPlatform != hostPlatform) crossConfigureFlags - ++ lib.optional (targetPlatform != hostPlatform) "--disable-bootstrap" + ++ lib.optional disableBootstrap "--disable-bootstrap" # Platform-specific flags ++ lib.optional (targetPlatform == hostPlatform && targetPlatform.isx86_32) "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"