diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix index 3919fbe89f3832e..b2330abd4b75b5c 100644 --- a/pkgs/development/compilers/gcc/11/default.nix +++ b/pkgs/development/compilers/gcc/11/default.nix @@ -249,9 +249,11 @@ stdenv.mkDerivation ({ targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; - buildFlags = optional - (targetPlatform == hostPlatform && hostPlatform == buildPlatform) - (if profiledCompiler then "profiledbootstrap" else "bootstrap"); + buildFlags = + let target = + lib.optionalString (profiledCompiler) "profiled" + + lib.optionalString (targetPlatform == hostPlatform && hostPlatform == buildPlatform && !disableBootstrap) "bootstrap"; + in lib.optional (target != "") target; inherit (callFile ../common/strip-attributes.nix { }) stripDebugList diff --git a/pkgs/development/compilers/gcc/12/default.nix b/pkgs/development/compilers/gcc/12/default.nix index baa8351830e0cb6..78dc30a34463e82 100644 --- a/pkgs/development/compilers/gcc/12/default.nix +++ b/pkgs/development/compilers/gcc/12/default.nix @@ -284,9 +284,11 @@ stdenv.mkDerivation ({ targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; - buildFlags = optional - (targetPlatform == hostPlatform && hostPlatform == buildPlatform) - (if profiledCompiler then "profiledbootstrap" else "bootstrap"); + buildFlags = + let target = + lib.optionalString (profiledCompiler) "profiled" + + lib.optionalString (targetPlatform == hostPlatform && hostPlatform == buildPlatform && !disableBootstrap) "bootstrap"; + in lib.optional (target != "") target; inherit (callFile ../common/strip-attributes.nix { }) stripDebugList