Open yowl opened 5 hours ago
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas See info in area-owners.md if you want to be subscribed.
Actually realised that the source generator already creates:
[UnmanagedCallersOnly(EntryPoint = "XpfSimple__GeneratedInitializer__Register_")]
private static void __Register__Export()
{
__Register_();
}
Which looks like it is for this purpose, I'll close this for now.
I want to ask if anyone thinks there is prior art for this problem, https://github.com/dotnet/runtimelab/issues/2626
In NativeAOT-LLVM, if a library is referenced that contains
JSExport
, we need to mark it asUnmanagedCallersOnly
in addition so we can root it, export it, and get the right calling convention. Example is theRegister
method created by the JSExport source generator. Rooting can be solved with theRdXmlRootProvider
but the other problems are harder. One way is to change the source generator to always add it, and another way, not necessarily correct, is to view this as: "NativeAOT requires additional attributes that the library author might not be aware of", so I was wondering if there is any prior art?Thanks!