From b39481bc09a6bede802f0bb7b805694ea9cf7f2d Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sat, 8 Jul 2023 11:03:41 +0300 Subject: [PATCH] gcc: fix build on x86_64-darwin --- pkgs/development/compilers/gcc/common/configure-flags.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/compilers/gcc/common/configure-flags.nix b/pkgs/development/compilers/gcc/common/configure-flags.nix index aa8ecc62e55a..accd08088c28 100644 --- a/pkgs/development/compilers/gcc/common/configure-flags.nix +++ b/pkgs/development/compilers/gcc/common/configure-flags.nix @@ -244,6 +244,11 @@ let ++ lib.optionals (langD) [ "--with-target-system-zlib=yes" ] + # Clang 11 performs an optimization on x86_64 that is sensitive to the presence of debug info. + # This causes GCC to fail to bootstrap due to object file differences between stages 2 and 3. + ++ lib.optionals (targetPlatform.isDarwin && targetPlatform.isx86_64) [ + "--with-as=${targetPackages.darwin.cctools-port}/bin/${targetPrefix}as" + ] ; in configureFlags