mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-14 08:07:38 +00:00
cc-wrapper hardeningFlags tests: fix stdenvUnsupport-based tests
these were not updated to understand hardeningUnsupportedFlagsByTargetPlatform when it was added causing more tests to fail for clang than otherwise would
This commit is contained in:
parent
38b580b21a
commit
2e0d7e230a
@ -44,8 +44,19 @@ let
|
||||
|
||||
stdenvUnsupport = additionalUnsupported: stdenv.override {
|
||||
cc = stdenv.cc.override {
|
||||
cc = (lib.extendDerivation true {
|
||||
hardeningUnsupportedFlags = (stdenv.cc.cc.hardeningUnsupportedFlags or []) ++ additionalUnsupported;
|
||||
cc = (lib.extendDerivation true rec {
|
||||
# this is ugly - have to cross-reference from
|
||||
# hardeningUnsupportedFlagsByTargetPlatform to hardeningUnsupportedFlags
|
||||
# because the finalAttrs mechanism that hardeningUnsupportedFlagsByTargetPlatform
|
||||
# implementations use to do this won't work with lib.extendDerivation.
|
||||
# but it's simplified by the fact that targetPlatform is already fixed
|
||||
# at this point.
|
||||
hardeningUnsupportedFlagsByTargetPlatform = _: hardeningUnsupportedFlags;
|
||||
hardeningUnsupportedFlags = (
|
||||
if stdenv.cc.cc ? hardeningUnsupportedFlagsByTargetPlatform
|
||||
then stdenv.cc.cc.hardeningUnsupportedFlagsByTargetPlatform stdenv.targetPlatform
|
||||
else (stdenv.cc.cc.hardeningUnsupportedFlags or [])
|
||||
) ++ additionalUnsupported;
|
||||
} stdenv.cc.cc);
|
||||
};
|
||||
allowedRequisites = null;
|
||||
@ -258,7 +269,7 @@ in nameDrvAfterAttrName ({
|
||||
# mechanism, so can only test a couple of flags through altered
|
||||
# stdenv trickery
|
||||
|
||||
fortifyStdenvUnsupp = checkTestBin (f2exampleWithStdEnv (stdenvUnsupport ["fortify"]) {
|
||||
fortifyStdenvUnsupp = checkTestBin (f2exampleWithStdEnv (stdenvUnsupport ["fortify" "fortify3"]) {
|
||||
hardeningEnable = [ "fortify" ];
|
||||
}) {
|
||||
ignoreFortify = false;
|
||||
|
Loading…
Reference in New Issue
Block a user