[NativeAOT] Refactor Linq feature switches (#89308)
authorIvan Povazan <55002338+ivanpovazan@users.noreply.github.com>
Tue, 25 Jul 2023 11:27:31 +0000 (13:27 +0200)
committerGitHub <noreply@github.com>
Tue, 25 Jul 2023 11:27:31 +0000 (13:27 +0200)
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
src/libraries/System.Linq.Expressions/src/ILLink/ILLink.Substitutions.xml

index e756e58..17463ba 100644 (file)
@@ -41,6 +41,13 @@ The .NET Foundation licenses this file to you under the MIT license.
     <DynamicCodeSupport Condition="'$(DynamicCodeSupport)' == ''">false</DynamicCodeSupport>
   </PropertyGroup>
 
+  <!-- Configure LINQ expressions -->
+  <ItemGroup>
+    <RuntimeHostConfigurationOption Include="System.Linq.Expressions.CanEmitObjectArrayDelegate"
+                                    Value="false"
+                                    Trim="true" />
+  </ItemGroup>
+
   <PropertyGroup Condition="'$(SuppressAotAnalysisWarnings)' == 'true'">
     <EnableAotAnalyzer Condition="'$(EnableAotAnalyzer)' == ''">false</EnableAotAnalyzer>
   </PropertyGroup>
@@ -274,11 +281,6 @@ The .NET Foundation licenses this file to you under the MIT license.
 
       <IlcArg Condition="$(IlcDisableReflection) == 'true'" Include="--feature:System.Reflection.IsReflectionExecutionAvailable=false" />
 
-      <!-- Configure LINQ expressions - disable Emit everywhere -->
-      <IlcArg Include="--feature:System.Linq.Expressions.CanCompileToIL=false" />
-      <IlcArg Include="--feature:System.Linq.Expressions.CanEmitObjectArrayDelegate=false" />
-      <IlcArg Include="--feature:System.Linq.Expressions.CanCreateArbitraryDelegates=false" />
-
       <!-- Linux Bionic doesn't ship GSSAPI, so enable managed implementation -->
       <IlcArg Condition="'$(_linuxLibcFlavor)' == 'bionic'" Include="--feature:System.Net.Security.UseManagedNtlm=true" />
 
index 2847ed8..b64cc2d 100644 (file)
@@ -1,13 +1,7 @@
 <linker>
   <assembly fullname="System.Linq.Expressions">
-    <type fullname="System.Linq.Expressions.LambdaExpression">
-      <method signature="System.Boolean get_CanCompileToIL()" feature="System.Linq.Expressions.CanCompileToIL" featurevalue="false" body="stub" value="false" />
-    </type>
     <type fullname="System.Dynamic.Utils.DelegateHelpers">
       <method signature="System.Boolean get_CanEmitObjectArrayDelegate()" feature="System.Linq.Expressions.CanEmitObjectArrayDelegate" featurevalue="false" body="stub" value="false" />
     </type>
-    <type fullname="System.Linq.Expressions.Interpreter.CallInstruction">
-      <method signature="System.Boolean get_CanCreateArbitraryDelegates()" feature="System.Linq.Expressions.CanCreateArbitraryDelegates" featurevalue="false" body="stub" value="false" />
-    </type>
   </assembly>
 </linker>