Skip to content

Commit

Permalink
stdenv: fix evaluation if !stdenv.cc.hasCC
Browse files Browse the repository at this point in the history
stdenv.cc may throw, e.g. in the case of pkgsCross.ghcjs where we must
not force it for the purpose of attribute accessing (`or` doesn't
implicitly tryEval…).

Regression introduced in 1a5bd69.
  • Loading branch information
sternenseemann committed Jan 13, 2024
1 parent 3d673c9 commit f734056
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkgs/stdenv/generic/make-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,10 @@ let
"stackprotector"
"strictoverflow"
];
defaultHardeningFlags = stdenv.cc.defaultHardeningFlags or
# fallback safe-ish set of flags
(remove "pie" knownHardeningFlags);
defaultHardeningFlags =
(if stdenv.hasCC then stdenv.cc else {}).defaultHardeningFlags or
# fallback safe-ish set of flags
(remove "pie" knownHardeningFlags);
enabledHardeningOptions =
if builtins.elem "all" hardeningDisable'
then []
Expand Down

0 comments on commit f734056

Please sign in to comment.