Welcome to mirror list, hosted at ThFree Co, Russian Federation.

how-to-build-and-run-ilcompiler-in-visual-studio-2015.md « Documentation - github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 10802736309d1c67883d0754c0724f4d68cd5d34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
_Please ensure that [pre-requisites](prerequisites-for-building.md) are installed for a successful build of the repo._

_Note_:

* Instructions below assume `c:\corert` is the repo root.

# Build ILCompiler #

Build your repo by issuing the following command at repo root:

```
build.cmd
```

If you changed `c:\corert\src\ILCompiler\repro\project.json`

```
build.cmd clean
```

_Note: The size of NuGet packages is approximately 2.75 GB, so download might take a few moments based on the speed of your internet connection. The build artifacts require additional ~1 GB, thus make sure you have at least 4 GB of free space._

## Using RyuJIT ##

1. Open c:\corert\src\ILCompiler\ILCompiler.sln in VS

  - Set "desktop" project in solution explorer as your startup project

  - Set startup command line to:
`@c:\corert\bin\obj\Windows_NT.x64.Debug\ryujit.rsp`

  - Build & run using **F5**
    - This will run the compiler. The output is `c:\corert\bin\obj\Windows_NT.x64.Debug\repro\native\repro.obj` file.

  - The repro project has a dummy program that you can modify for ad-hoc testing

  - To suppress spew from NuGet during the build, go to NuGet Package Manager in Options, and uncheck `Allow NuGet to download missing packages`.

2. Open `c:\corert\src\ILCompiler\reproNative\reproNative.vcxproj`

  - Set breakpoint at ```__managed__Main``` in main.cpp
  - Build & run using **F5**
    - Once you hit the breakpoint, go to disassembly and step into - you are looking at the code generated by RyuJIT


## Using CPP Code Generator ##

1. Open `c:\corert\src\ILCompiler\ILCompiler.sln` in VS

  - Set "desktop" project in solution explorer as your startup project

  - Set startup command line to:
`@c:\corert\bin\obj\Windows_NT.x64.Debug\cpp.rsp`

    - `--nolinenumbers` command line option can be used to suppress generation of line number mappings in C++ files - useful for debugging

  - Build & run using **F5**
    - This will run the compiler. The output is `c:\corert\bin\obj\Windows_NT.x64.Debug\repro\native\repro.cpp` file.

  - The repro project has a dummy program that you can modify for ad-hoc testing

2. Open `c:\corert\src\ILCompiler\reproNative\reproNativeCpp.vcxproj`

  - Set breakpoint at repro::Program::Main in main.cpp
  - Build, run & step through as with any other C++ program