The .NET SDK has some options to integrate NativeAOT with a larger application. You can reference libraries (static or dynamic) and object files during the build to link into the final executable. You can also configure NativeAOT to generate a static or dynamic library that you can link into another executable.
Notice how that page describes how to configure the toolchain using XML. That's the thing I don't like -- instead of just building up an args list like cl.exe, I need to write my own intermediate tooling that synthesizes a .csproj and spits it out into the build sandbox before launching their magic do-everything binary.
There's clearly something else underneath, the <LinkerArg> element is exactly what I would want to generate when running link.exe, but most of the configuration options are wrapped in a layer of gunk.
Ideally it would be possible to invoke a command directly to convert a bunch of *.cs files into a .dll (or .a), then I could use existing logic to link it with link.exe (or ld).
https://learn.microsoft.com/en-us/dotnet/core/deploying/nati...