From 8a05f77b5d4d8422624828f9744daee1b9b213d4 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Tue, 7 Mar 2023 02:04:27 -0800 Subject: [PATCH] https://github.com/NixOS/nixpkgs/pull/217995#pullrequestreview-1318620540 --- pkgs/development/compilers/gcc/11/default.nix | 6 ++++-- pkgs/development/compilers/gcc/12/default.nix | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix index 2f6e986f3eb8b..b2330abd4b75b 100644 --- a/pkgs/development/compilers/gcc/11/default.nix +++ b/pkgs/development/compilers/gcc/11/default.nix @@ -250,8 +250,10 @@ stdenv.mkDerivation ({ targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; buildFlags = - lib.optionalString (profiledCompiler) "profiled" + - lib.optionalString (targetPlatform == hostPlatform && hostPlatform == buildPlatform && !disableBootstrap) "bootstrap"; + 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 ea3c6b2b16b52..f83c8398cd0f7 100644 --- a/pkgs/development/compilers/gcc/12/default.nix +++ b/pkgs/development/compilers/gcc/12/default.nix @@ -282,8 +282,10 @@ stdenv.mkDerivation ({ targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; buildFlags = - lib.optionalString (profiledCompiler) "profiled" + - lib.optionalString (targetPlatform == hostPlatform && hostPlatform == buildPlatform && !disableBootstrap) "bootstrap"; + 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