stdenv.mkDerivation: inline hardeningDisable'
We can safely check `elem "all" hardeningDisable'` on the original list, because calling `unique` and `concretizeFlagImplications` will never change whether the list contains "all".
This commit is contained in:
@@ -413,21 +413,20 @@ let
|
||||
actualValue;
|
||||
outputs' = if separateDebugInfo' then outputs ++ [ "debug" ] else outputs;
|
||||
|
||||
hardeningDisable' = unique (
|
||||
pipe hardeningDisable [
|
||||
# disabling fortify implies fortify3 should also be disabled
|
||||
(concretizeFlagImplications "fortify" [ "fortify3" ])
|
||||
# disabling strictflexarrays1 implies strictflexarrays3 should also be disabled
|
||||
(concretizeFlagImplications "strictflexarrays1" [ "strictflexarrays3" ])
|
||||
# disabling libcxxhardeningfast implies libcxxhardeningextensive should also be disabled
|
||||
(concretizeFlagImplications "libcxxhardeningfast" [ "libcxxhardeningextensive" ])
|
||||
]
|
||||
);
|
||||
enabledHardeningOptions =
|
||||
if elem "all" hardeningDisable' then
|
||||
if elem "all" hardeningDisable then
|
||||
[ ]
|
||||
else
|
||||
subtractLists hardeningDisable' (defaultHardeningFlags ++ hardeningEnable);
|
||||
subtractLists (unique (
|
||||
pipe hardeningDisable [
|
||||
# disabling fortify implies fortify3 should also be disabled
|
||||
(concretizeFlagImplications "fortify" [ "fortify3" ])
|
||||
# disabling strictflexarrays1 implies strictflexarrays3 should also be disabled
|
||||
(concretizeFlagImplications "strictflexarrays1" [ "strictflexarrays3" ])
|
||||
# disabling libcxxhardeningfast implies libcxxhardeningextensive should also be disabled
|
||||
(concretizeFlagImplications "libcxxhardeningfast" [ "libcxxhardeningextensive" ])
|
||||
]
|
||||
)) (defaultHardeningFlags ++ hardeningEnable);
|
||||
# hardeningDisable additionally supports "all".
|
||||
erroneousHardeningFlags = subtractLists knownHardeningFlags (
|
||||
hardeningEnable ++ remove "all" hardeningDisable
|
||||
|
||||
Reference in New Issue
Block a user