Skip to content

Investigate whether we can set ILC/ILLinker feature flags using RuntimeHostConfigurationOption #18483

@rolfbjarne

Description

@rolfbjarne

Ref: #17374 (comment)

Look into whether we can change this:

<PropertyGroup>
	<!-- Set the features for ILLink -->
	<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --feature ObjCRuntime.Runtime.Arch.IsSimulator $(_IsSimulatorFeature)</_ExtraTrimmerArgs>
	<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --feature ObjCRuntime.Runtime.IsManagedStaticRegistrar $(_IsManagedStaticRegistrarFeature)</_ExtraTrimmerArgs>
	<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --feature ObjCRuntime.Runtime.IsNativeAOT $(_IsNativeAOTFeature)</_ExtraTrimmerArgs>
</PropertyGroup>

<ItemGroup>
	<!-- Set the features for ILC -->
	<IlcArg Include="--feature:ObjCRuntime.Runtime.Arch.IsSimulator=$(_IsSimulatorFeature)" />
	<IlcArg Include="--feature:ObjCRuntime.Runtime.IsManagedStaticRegistrar=$(_IsManagedStaticRegistrarFeature)" />
	<IlcArg Include="--feature:ObjCRuntime.Runtime.IsNativeAOT=$(_IsNativeAOTFeature)" />
</ItemGroup>

from here: f39d80b (#17374)

to using RuntimeHostConfigurationOption items:

https://github.com/dotnet/sdk/blob/20b2949041a3cb8ab5f4a4c030ed280540b94e4f/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets#L485-L488

and that should hopefully work for both ILC and ILLinker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue or pull request is an enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions