From 926c920c12703883a7e946e9bbebf8d0d00af31a Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 2 Jul 2023 18:44:28 -0700 Subject: [PATCH] gcc: tighten condition for inhibit_libc=true The situation described in the comment preceding `export inhibit_libc=true` does not match the conditional which follows it. Specifically, the comment says that this line is meant for "clang builds gcc" situations, yet it is enabled even when `!stdenv.cc.isClang`. This commit tightens the conditional to make it match the situation described in the comment. --- pkgs/development/compilers/gcc/common/pre-configure.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/gcc/common/pre-configure.nix b/pkgs/development/compilers/gcc/common/pre-configure.nix index e386693b22c7a..5a74c5647293a 100644 --- a/pkgs/development/compilers/gcc/common/pre-configure.nix +++ b/pkgs/development/compilers/gcc/common/pre-configure.nix @@ -108,7 +108,10 @@ in lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) '' # gcc->clang "cross"-compilation manages to evade it: there # hostPlatform != targetPlatform, hostPlatform.config == targetPlatform.config. # We explicitly inhibit libc headers use in this case as well. -+ lib.optionalString (targetPlatform != hostPlatform && withoutTargetLibc) '' ++ lib.optionalString (targetPlatform != hostPlatform && + withoutTargetLibc && + targetPlatform.config == hostPlatform.config && + (stdenv.cc.isClang || stdenv.targetPlatform.useLLVM)) '' export inhibit_libc=true ''