summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorArtturi <Artturin@artturin.com>2023-10-05 04:43:53 +0300
committerGitHub <noreply@github.com>2023-10-05 04:43:53 +0300
commitc748544b2f3bc3c7716c91ccedb2b2fef300e789 (patch)
tree374a030ab465ef653edd12a0843b885ec8b3c704 /pkgs
parent25c3b03038cfd5e01b8a63e6e0179b59759af00b (diff)
parent926c920c12703883a7e946e9bbebf8d0d00af31a (diff)
Merge pull request #241206 from amjoseph-nixpkgs/tighten-inhibit_libc-condition
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/gcc/common/pre-configure.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkgs/development/compilers/gcc/common/pre-configure.nix b/pkgs/development/compilers/gcc/common/pre-configure.nix
index 32e203ee49128..88a0bda3d0c66 100644
--- a/pkgs/development/compilers/gcc/common/pre-configure.nix
+++ b/pkgs/development/compilers/gcc/common/pre-configure.nix
@@ -119,7 +119,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
 ''