Do not dehydrate data if CFG is enabled (#78546)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Fri, 18 Nov 2022 15:50:31 +0000 (00:50 +0900)
committerGitHub <noreply@github.com>
Fri, 18 Nov 2022 15:50:31 +0000 (07:50 -0800)
Two reasons:
1. CFG is already bigger because of all the extra checks. It's by design.
2. We might prefer to keep as many things readonly as possible.
3. This way at least some testing will run to ensure we didn't regress the non-dehydrated configuration.

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets

index f81642b..acb4b62 100644 (file)
@@ -214,7 +214,7 @@ The .NET Foundation licenses this file to you under the MIT license.
       <IlcArg Condition="$(IlcGenerateMetadataLog) == 'true'" Include="--metadatalog:$(NativeIntermediateOutputPath)%(ManagedBinary.Filename).metadata.csv" />
       <IlcArg Condition="$(TargetArchitecture) != ''" Include="--targetarch:$(TargetArchitecture)" />
       <IlcArg Condition="$(IlcMultiModule) == 'true'" Include="--multifile" />
-      <IlcArg Condition="$(IlcMultiModule) != 'true' and '$(IlcDehydrate)' != 'false'" Include="--dehydrate" />
+      <IlcArg Condition="$(IlcMultiModule) != 'true' and '$(IlcDehydrate)' != 'false' and '$(ControlFlowGuard)' != 'Guard'" Include="--dehydrate" />
       <IlcArg Condition="$(Optimize) == 'true'" Include="-O" />
       <IlcArg Condition="$(NativeDebugSymbols) == 'true'" Include="-g" />
       <IlcArg Condition="$(IlcDwarfVersion) == '5'" Include="--gdwarf-5" />