This repository was archived by the owner on Nov 1, 2020. It is now read-only.
This repository was archived by the owner on Nov 1, 2020. It is now read-only.
Question: Recommended way to add cross target support to the compiler. #8287
Open
Description
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
- Add DLLImports for all possible variants and choose the right one when RyuJIT needs to be loaded. Easy solution but would require more work every time a new CPU target OS is added.
- Load the correct RyuJIT dynamic with LoadLibrary/GetProcAddress (on windows). Very flexible but would require a custom implementation for every host system as the way to load a dynamic lib is different everywhere
- Use reflection emit to generate the needed pinvokes. It's flexible and will work on all host systems the same. But will prevent to AOT the compiler if this is planned at some point.
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.
Metadata
Metadata
Assignees
Labels
No labels