GithubHelp home page GithubHelp logo

ahmed605 / projectrt Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 0.0 1022 KB

.NET Native but with CoreRT's ILCompiler

License: MIT License

C++ 0.13% C# 99.86% Batchfile 0.01%
corert csharp dotnet ilc net-native projectn projectx redhawk uwp ilcompiler

projectrt's Introduction

ProjectRT

Experimental project aiming at making it possible to use .NET Native with CoreRT's ILCompiler and MSVC's link.exe instead of Bartok/Triton MDIL Compiler of nutc_driver.exe and rhbind.exe.

Currently only the x64 target is tested and confirmed to be working, but support for x86 and ARM32 is planned.

Note

.NET Native already uses CoreRT's ILCompiler for the ARM64 target (codenamed ProjectX) unlike for the x86, x64, and ARM32 targets so you don't need this project for ARM64 targets.

Usage

Note

Usage guide below is temporary until a proper installation method is there.

  1. Compile bootstrap, bootstrap_dll, shimAppDll, and shimExe on the Release configuration.

  2. Copy the compiled .libs to .NET Native's Nuget package ilc tools folder (.nuget\runtime.win10-x64.microsoft.net.native.compiler.2.2.12-rel-31116-00\tools\x64\ilc\tools).

  3. Download mrt100X_app.lib to .NET Native's Nuget package ilc runtime libs folder (.nuget\runtime.win10-x64.microsoft.net.native.compiler.2.2.12-rel-31116-00\tools\x64\ilc\Lib\Runtime).

  4. Duplicate mrt100_app.dll and name the duplicated copy mrt100X_app.dll.

  5. Copy ILCompiler.Compiler.dll, ILCompiler.DependencyAnalysisFramework.dll, ILCompiler.Host.dll, ILCompiler.MetadataTransform.dll, and ILCompiler.TypeSystem.dll from arm64 ilc tools folder to x64 ilc tools folder (.nuget\runtime.win10-arm64.microsoft.net.native.compiler.2.2.12-rel-31116-00\tools\arm64\ilc\tools -> .nuget\runtime.win10-x64.microsoft.net.native.compiler.2.2.12-rel-31116-00\tools\x64\ilc\tools).

  6. Open ILCompiler.Host.dll in dnSpy, then navigate to ILCompilerHost.AddTocModule, then Edit Method, then replace File.OpenRead(filename) with File.OpenRead(filename.Replace("win10-x64", "win10-arm64")), then Compile, and finally File > Save Module.

  7. Add this to your app's csproj (tweak the paths as needed)

<UseDotNetNativeSharedAssemblyFrameworkPackage>false</UseDotNetNativeSharedAssemblyFrameworkPackage>
<IlcParameters>/PureNative /LinkPath:"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64" /NativeLibPath:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64"</IlcParameters>
  1. Profit!

Screenshot because why not

image

projectrt's People

Contributors

ahmed605 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.