-
Notifications
You must be signed in to change notification settings - Fork 508
Question: Recommended way to add cross target support to the compiler. #8287
Comments
We have an implementation for this here: corert/src/JitInterface/src/JitConfigProvider.cs Lines 45 to 64 in 34af164
It's used by the crossgen2 AOT compiler over in the dotnet/runtime repo (crossgen2 targets CoreCLR and generates CoreCLR's ReadyToRun assemblies, which is CoreCLR's AOT technology). CoreRT AOT compiler shares a lot of code with crossgen2. This code is currently ifdeffed out because the We'll get this "for free" once the migration to the dotnet/runtimelab repo is completed because that build tooling already does that (hopefully, in the coming weeks). We can just mirror what crossgen2 is doing. There's also dotnet/runtime#41126 in flight which will make it possible to build crosstargeting RyuJITs by passing flags to the root build script. The runtimelab repo will get that "for free" too. |
Thanks for the information. In this case I will just use my hack a little bit longer. |
If you have one or more RyuJIT variants that are compiled to generated code for a different CPU/target OS the CoreRT compiler is able to do cross compile. I successfully tested this with AMD64/Windows => AMD64/Unix and AMD64/Windows => ARM64/Unix.
But to make it actually work I ether need to replace clrjitilc with the needed variant or change the JitLibrary constant. Both solutions are not optimal.
I currently see 3 options
In any case this codepath might only be used when the host and target are different. If they are the same the current solution can still be used.
The text was updated successfully, but these errors were encountered: