Skip to content

Conversation

@MichalStrehovsky
Copy link
Member

link.exe hardcodes a list of magic symbol names that it thinks should not be generated into import library and emits warnings if they are.

We don't have a mechanism to set visibility of UnmanagedCallersOnly methods and I don't think we'd want to make a public API for that. But this means that users get a warning that is not particularly actionable. We could either replicate this magic list of symbol names into compiler and generate these as PRIVATE (but then how do people opt out if they don't actually want this as PRIVATE?), or we can just suppress the warning.

This PR suppresses the warning.

Cc @dotnet/ilc-contrib @Sergio0694

@ghost
Copy link

ghost commented Feb 7, 2024

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

link.exe hardcodes a list of magic symbol names that it thinks should not be generated into import library and emits warnings if they are.

We don't have a mechanism to set visibility of UnmanagedCallersOnly methods and I don't think we'd want to make a public API for that. But this means that users get a warning that is not particularly actionable. We could either replicate this magic list of symbol names into compiler and generate these as PRIVATE (but then how do people opt out if they don't actually want this as PRIVATE?), or we can just suppress the warning.

This PR suppresses the warning.

Cc @dotnet/ilc-contrib @Sergio0694

Author: MichalStrehovsky
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@ghost ghost assigned MichalStrehovsky Feb 7, 2024
<LinkerArg Condition="'$(OutputType)' == 'WinExe' or '$(OutputType)' == 'Exe'" Include="/ENTRY:$(EntryPointSymbol) /NOEXP /NOIMPLIB" />
<LinkerArg Include="/NATVIS:&quot;$(MSBuildThisFileDirectory)NativeAOT.natvis&quot;" />
<LinkerArg Condition="'$(ControlFlowGuard)' == 'Guard'" Include="/guard:cf" />
<LinkerArg Include="/IGNORE:4104" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth it to add a comment here with some context, maybe a link to the original issue or something so people will be able to understand why this is here? This suppression seems a bit random and arbitrary otherwise, and I could imagine folks having no idea about the WinRT shenanigans being confused when looking at this 😅

@jkotas jkotas closed this Feb 8, 2024
@jkotas jkotas reopened this Feb 8, 2024
@MichalStrehovsky MichalStrehovsky merged commit f64c078 into main Feb 8, 2024
@MichalStrehovsky MichalStrehovsky deleted the MichalStrehovsky-patch-2 branch February 8, 2024 12:38
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants