-
Notifications
You must be signed in to change notification settings - Fork 4
/
INSTALL
78 lines (44 loc) · 2.33 KB
/
INSTALL
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
66
67
68
69
70
71
72
73
74
75
76
77
78
Installing HLVM
===============
Dependencies
------------
. libsigsegv >=2.5.
. LLVM sources >=2.8.
. OCaml >=3.10.2.
Installation
------------
Configure, build and install LLVM 2.6 with:
$ ./configure --with-ocaml-libdir=`ocamlc -where`
$ make -j12
$ sudo make install
WARNING: If you are using Ubuntu then you may need to disable GCC's stack smashing tests by passing gcc the -fno-stack-protector flag. The stack smashing checks seem to conflict with libsigsegv's handling of stack overflows.
HLVM and its auxiliary LLVM OCaml bindings may be compiled using the script:
$ ./compile.sh
This creates an "hlvm" executable that, when run, incrementally JIT compiles and benchmarks a series of tests.
Debug mode
----------
Debug mode may be enabled with:
$ ./hlvm --debug
in which case extensive information is printed to the console describing the process of compilation (which is ideal for debugging when LLVM calls abort due to a type error in the generated code) and also from print statements injected into the generated code itself (e.g. to describe what the GC is doing as it runs).
The generated functions may also be visualized using LLVM by running HLVM with:
$ ./hlvm --view-functions
Run-time options
----------------
--compile Just compile the generated code and don't run it.
--debug Print verbose debug information both as HLVM is generating
code and injecting trace print statements into the generated
code to print debug information as the compiled program
runs.
--no-gc Disable GC cycles but maintain the shadow stack.
--no-shadow-stack Disable both the shadow stack and GC.
--no-tco Disable the elimination of tail calls by LLVM.
--view-functions Visualize functions as HLVM generates them.
Standalone compilation and optimization
---------------------------------------
Running HLVM produces LLVM bitcode output in the aout.bc file. This may be compiled into an
optimized standalone executable with:
$ ./opt.sh
The resulting aout executable is the result of standalone compilation to
native code.
The aoutopt executable demonstrates what LLVM's IR optimization passes can accomplish. In this case, we find that the performance improvement is very small because HLVM already generates efficient LLVM IR.
-- Jon Harrop <[email protected]>