Commit 926c920c authored by Adam Joseph's avatar Adam Joseph
Browse files

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.
parent ebaae879
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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
''