nixpkgs/pkgs/stdenv
Robert Scott 1a5bd697ad mkDerivation, bintools-wrapper: move defaultHardeningFlags determination to bintools-wrapper
this makes it a lot easier to create a modified stdenv with a
different set of defaultHardeningFlags and as a bonus allows us
to inject the correct defaultHardeningFlags into toolchain wrapper
scripts, reducing repetition.

while most hardening flags are arguably more of a compiler thing,
it works better to put them in bintools-wrapper because cc-wrapper
can easily refer to bintools but not vice-versa.

mkDerivation can still easily refer to either when it is constructed.

this also switches fortran-hook.sh to use the same defaults for
NIX_HARDENING_ENABLE as for C. previously NIX_HARDENING_ENABLE
defaults were apparently used to avoid passing problematic flags
to a fortran compiler, but this falls apart as soon as mkDerivation
sets its own NIX_HARDENING_ENABLE - cc.hardeningUnsupportedFlags
is a more appropriate mechanism for this as it actively filters
out flags from being used by the wrapper, so switch to using that
instead.

this is still an imperfect mechanism because it doesn't handle a
compiler which has both langFortran *and* langC very well - applying
the superset of the two's hardeningUnsupportedFlags to either
compiler's invocation. however this is nothing new - cc-wrapper
already poorly handles a langFortran+langC compiler, applying two
setup hooks that have contradictory options.
2023-12-09 16:30:45 +00:00
..
cross
custom
cygwin
darwin treewide: remove unreferenced patch files 2023-12-01 06:11:20 +01:00
freebsd
generic mkDerivation, bintools-wrapper: move defaultHardeningFlags determination to bintools-wrapper 2023-12-09 16:30:45 +00:00
linux stdenv: fix typo 2023-10-21 00:26:57 +03:00
native stdenv: fix stagesNative 2023-07-02 19:07:23 +10:00
nix
tests
adapters.nix Merge pull request #265307 from reckenrode/clang16-fixes-batch2 2023-11-04 17:14:36 +01:00
booter.nix pkgs/stdenv: fix typo in booter.nix docs 2023-09-04 22:24:12 +02:00
default.nix darwin.stdenv: refactor stdenv definition 2023-07-02 17:56:24 -04:00