Skip to content

Commit bb0b5bc

Browse files
[illink] enable serialization discovery for the linker
Context: dotnet/linker#2929 Context: https://github.com/dotnet/linker/blob/6e8e139a484f74c524c821c7a4a08287d77257a4/src/ILLink.Tasks/build/Microsoft.NET.ILLink.targets#L227-L229 Fixes: #7256 Serialization heuristics in the .NET 7 linker is now opt-in. We now need to pass a new flag to the linker by default: <_ExtraTrimmerArgs>--enable-serialization-discovery $(_ExtraTrimmerArgs)</_ExtraTrimmerArgs> This might also solve project builds in `Release` mode that appear to hang: Task "ILLink" (TaskId:272) Builds appear to be running this task and never exit. Let's hope this also solves this?
1 parent 7fb5eda commit bb0b5bc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.ILLink.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This file contains the .NET 5-specific targets to customize ILLink
1515
DependsOnTargets="GetReferenceAssemblyPaths;_CreatePropertiesCache">
1616
<PropertyGroup>
1717
<TrimmerRemoveSymbols Condition=" '$(AndroidIncludeDebugSymbols)' != 'true' ">true</TrimmerRemoveSymbols>
18+
<_ExtraTrimmerArgs Condition=" '$(_EnableSerializationDiscovery)' != 'false' ">--enable-serialization-discovery $(_ExtraTrimmerArgs)</_ExtraTrimmerArgs>
1819
<!--
1920
Used for the <ILLink DumpDependencies="$(_TrimmerDumpDependencies)" /> value:
2021
https://github.com/dotnet/sdk/blob/a5393731b5b7b225692fff121f747fbbc9e8b140/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets#L150

0 commit comments

Comments
 (0)