Disable linker warning LNK4104 when building native AOT libraries#98084
Disable linker warning LNK4104 when building native AOT libraries#98084MichalStrehovsky merged 2 commits intomainfrom
Conversation
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue Detailslink.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 This PR suppresses the warning. Cc @dotnet/ilc-contrib @Sergio0694
|
| <LinkerArg Condition="'$(OutputType)' == 'WinExe' or '$(OutputType)' == 'Exe'" Include="/ENTRY:$(EntryPointSymbol) /NOEXP /NOIMPLIB" /> | ||
| <LinkerArg Include="/NATVIS:"$(MSBuildThisFileDirectory)NativeAOT.natvis"" /> | ||
| <LinkerArg Condition="'$(ControlFlowGuard)' == 'Guard'" Include="/guard:cf" /> | ||
| <LinkerArg Include="/IGNORE:4104" /> |
There was a problem hiding this comment.
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 😅
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
UnmanagedCallersOnlymethods 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 asPRIVATE(but then how do people opt out if they don't actually want this asPRIVATE?), or we can just suppress the warning.This PR suppresses the warning.
Cc @dotnet/ilc-contrib @Sergio0694