From 91ef45c98ad8b569cb39a5ddbb14894adb9822a3 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Thu, 29 Jun 2023 17:19:19 -0700 Subject: [PATCH] gcc: disable glibc<->libgcc circularity workaround for windows and LLVM This essentially reverts #238154 if `isWindows` or `useLLVM`, the two cases where it caused breakage: https://github.com/NixOS/nixpkgs/pull/238154#issuecomment-1633752094 Since #238154 exists mainly for `isGNU` (i.e. due to the glibc<->libgcc circular dependency) disabling it here isn't a big deal. --- pkgs/development/compilers/gcc/common/libgcc.nix | 3 ++- pkgs/top-level/all-packages.nix | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/gcc/common/libgcc.nix b/pkgs/development/compilers/gcc/common/libgcc.nix index 528d9d7d13ac7..626b14835c9a0 100644 --- a/pkgs/development/compilers/gcc/common/libgcc.nix +++ b/pkgs/development/compilers/gcc/common/libgcc.nix @@ -19,7 +19,7 @@ drv: lib.pipe drv (pkg: pkg.overrideAttrs (previousAttrs: lib.optionalAttrs ( targetPlatform != hostPlatform && - enableShared && + (enableShared || targetPlatform.libc == "msvcrt") && withoutTargetLibc ) { makeFlags = [ "all-gcc" "all-target-libgcc" ]; @@ -40,6 +40,7 @@ lib.optional (lib.versionAtLeast version "11.0") else "${targetPlatform.config}/"; enableLibGccOutput = + (!stdenv.targetPlatform.isWindows || (with stdenv; targetPlatform == hostPlatform)) && !langJit && !stdenv.hostPlatform.isDarwin && enableShared diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 33f821ec597c4..70b88faadf242 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15369,6 +15369,14 @@ with pkgs; langCC = false; libcCross = libcCross1; targetPackages.stdenv.cc.bintools = binutilsNoLibc; + enableShared = + stdenv.targetPlatform.hasSharedLibraries + + # temporarily disabled due to breakage; + # see https://github.com/NixOS/nixpkgs/pull/243249 + && !stdenv.targetPlatform.isWindows + && !(stdenv.targetPlatform.useLLVM or false) + ; }; bintools = binutilsNoLibc; libc = libcCross1;