immunio 0.15.4 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (454) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +0 -27
  3. data/ext/immunio/Rakefile +9 -0
  4. data/lib/immunio/plugins/active_record.rb +1 -1
  5. data/lib/immunio/plugins/active_record_relation.rb +1 -1
  6. data/lib/immunio/plugins/environment_reporter.rb +20 -0
  7. data/lib/immunio/rufus_lua_ext/ref.rb +1 -3
  8. data/lib/immunio/version.rb +1 -1
  9. data/lib/immunio/vm.rb +1 -2
  10. data/lua-hooks/Makefile +97 -0
  11. data/lua-hooks/ext/all.c +41 -52
  12. data/lua-hooks/ext/all.o +0 -0
  13. data/lua-hooks/ext/libinjection/libinjection_html5.o +0 -0
  14. data/lua-hooks/ext/libinjection/libinjection_sqli.o +0 -0
  15. data/lua-hooks/ext/libinjection/libinjection_xss.o +0 -0
  16. data/lua-hooks/ext/libinjection/lualib.c +2 -2
  17. data/lua-hooks/ext/lpeg/lpcap.c +2 -2
  18. data/lua-hooks/ext/lpeg/lpcap.o +0 -0
  19. data/lua-hooks/ext/lpeg/lpcode.c +2 -2
  20. data/lua-hooks/ext/lpeg/lpcode.h +1 -1
  21. data/lua-hooks/ext/lpeg/lpcode.o +0 -0
  22. data/lua-hooks/ext/lpeg/lpprint.o +0 -0
  23. data/lua-hooks/ext/lpeg/lptree.c +2 -2
  24. data/lua-hooks/ext/lpeg/lptypes.h +1 -1
  25. data/lua-hooks/ext/lpeg/lpvm.c +2 -2
  26. data/lua-hooks/ext/lpeg/lpvm.o +0 -0
  27. data/lua-hooks/ext/lua-cmsgpack/lua_cmsgpack.c +16 -3
  28. data/lua-hooks/ext/lua-snapshot/snapshot.c +14 -7
  29. data/lua-hooks/ext/luajit/COPYRIGHT +56 -0
  30. data/lua-hooks/ext/luajit/Makefile +159 -0
  31. data/lua-hooks/ext/luajit/README +16 -0
  32. data/lua-hooks/ext/luajit/doc/bluequad-print.css +166 -0
  33. data/lua-hooks/ext/luajit/doc/bluequad.css +325 -0
  34. data/lua-hooks/ext/luajit/doc/changes.html +804 -0
  35. data/lua-hooks/ext/luajit/doc/contact.html +104 -0
  36. data/lua-hooks/ext/luajit/doc/ext_c_api.html +189 -0
  37. data/lua-hooks/ext/luajit/doc/ext_ffi.html +332 -0
  38. data/lua-hooks/ext/luajit/doc/ext_ffi_api.html +570 -0
  39. data/lua-hooks/ext/luajit/doc/ext_ffi_semantics.html +1261 -0
  40. data/lua-hooks/ext/luajit/doc/ext_ffi_tutorial.html +603 -0
  41. data/lua-hooks/ext/luajit/doc/ext_jit.html +201 -0
  42. data/lua-hooks/ext/luajit/doc/ext_profiler.html +365 -0
  43. data/lua-hooks/ext/luajit/doc/extensions.html +448 -0
  44. data/lua-hooks/ext/luajit/doc/faq.html +186 -0
  45. data/lua-hooks/ext/luajit/doc/img/contact.png +0 -0
  46. data/lua-hooks/ext/luajit/doc/install.html +659 -0
  47. data/lua-hooks/ext/luajit/doc/luajit.html +236 -0
  48. data/lua-hooks/ext/luajit/doc/running.html +309 -0
  49. data/lua-hooks/ext/luajit/doc/status.html +118 -0
  50. data/lua-hooks/ext/luajit/dynasm/dasm_arm.h +456 -0
  51. data/lua-hooks/ext/luajit/dynasm/dasm_arm.lua +1125 -0
  52. data/lua-hooks/ext/luajit/dynasm/dasm_arm64.h +518 -0
  53. data/lua-hooks/ext/luajit/dynasm/dasm_arm64.lua +1166 -0
  54. data/lua-hooks/ext/luajit/dynasm/dasm_mips.h +416 -0
  55. data/lua-hooks/ext/luajit/dynasm/dasm_mips.lua +953 -0
  56. data/lua-hooks/ext/luajit/dynasm/dasm_ppc.h +419 -0
  57. data/lua-hooks/ext/luajit/dynasm/dasm_ppc.lua +1919 -0
  58. data/lua-hooks/ext/luajit/dynasm/dasm_proto.h +83 -0
  59. data/lua-hooks/ext/luajit/dynasm/dasm_x64.lua +12 -0
  60. data/lua-hooks/ext/luajit/dynasm/dasm_x86.h +471 -0
  61. data/lua-hooks/ext/luajit/dynasm/dasm_x86.lua +1945 -0
  62. data/lua-hooks/ext/luajit/dynasm/dynasm.lua +1094 -0
  63. data/lua-hooks/ext/luajit/etc/luajit.1 +88 -0
  64. data/lua-hooks/ext/luajit/etc/luajit.pc +25 -0
  65. data/lua-hooks/ext/luajit/src/Makefile +697 -0
  66. data/lua-hooks/ext/luajit/src/Makefile.dep +244 -0
  67. data/lua-hooks/ext/luajit/src/host/README +4 -0
  68. data/lua-hooks/ext/luajit/src/host/buildvm +0 -0
  69. data/lua-hooks/ext/luajit/src/host/buildvm.c +518 -0
  70. data/lua-hooks/ext/luajit/src/host/buildvm.h +105 -0
  71. data/lua-hooks/ext/luajit/src/host/buildvm.o +0 -0
  72. data/lua-hooks/ext/luajit/src/host/buildvm_arch.h +7449 -0
  73. data/lua-hooks/ext/luajit/src/host/buildvm_asm.c +345 -0
  74. data/lua-hooks/ext/luajit/src/host/buildvm_asm.o +0 -0
  75. data/lua-hooks/ext/luajit/src/host/buildvm_fold.c +229 -0
  76. data/lua-hooks/ext/luajit/src/host/buildvm_fold.o +0 -0
  77. data/lua-hooks/ext/luajit/src/host/buildvm_lib.c +457 -0
  78. data/lua-hooks/ext/luajit/src/host/buildvm_lib.o +0 -0
  79. data/lua-hooks/ext/luajit/src/host/buildvm_libbc.h +45 -0
  80. data/lua-hooks/ext/luajit/src/host/buildvm_peobj.c +368 -0
  81. data/lua-hooks/ext/luajit/src/host/buildvm_peobj.o +0 -0
  82. data/lua-hooks/ext/luajit/src/host/genlibbc.lua +197 -0
  83. data/lua-hooks/ext/luajit/src/host/genminilua.lua +428 -0
  84. data/lua-hooks/ext/luajit/src/host/minilua +0 -0
  85. data/lua-hooks/ext/luajit/src/host/minilua.c +7770 -0
  86. data/lua-hooks/ext/luajit/src/host/minilua.o +0 -0
  87. data/lua-hooks/ext/luajit/src/jit/bc.lua +190 -0
  88. data/lua-hooks/ext/luajit/src/jit/bcsave.lua +661 -0
  89. data/lua-hooks/ext/luajit/src/jit/dis_arm.lua +689 -0
  90. data/lua-hooks/ext/luajit/src/jit/dis_mips.lua +428 -0
  91. data/lua-hooks/ext/luajit/src/jit/dis_mipsel.lua +17 -0
  92. data/lua-hooks/ext/luajit/src/jit/dis_ppc.lua +591 -0
  93. data/lua-hooks/ext/luajit/src/jit/dis_x64.lua +17 -0
  94. data/lua-hooks/ext/luajit/src/jit/dis_x86.lua +838 -0
  95. data/lua-hooks/ext/luajit/src/jit/dump.lua +706 -0
  96. data/lua-hooks/ext/luajit/src/jit/p.lua +310 -0
  97. data/lua-hooks/ext/luajit/src/jit/v.lua +170 -0
  98. data/lua-hooks/ext/luajit/src/jit/vmdef.lua +362 -0
  99. data/lua-hooks/ext/luajit/src/jit/zone.lua +45 -0
  100. data/lua-hooks/ext/{lua → luajit/src}/lauxlib.h +10 -17
  101. data/lua-hooks/ext/luajit/src/lib_aux.c +356 -0
  102. data/lua-hooks/ext/luajit/src/lib_aux.o +0 -0
  103. data/lua-hooks/ext/luajit/src/lib_aux_dyn.o +0 -0
  104. data/lua-hooks/ext/luajit/src/lib_base.c +664 -0
  105. data/lua-hooks/ext/luajit/src/lib_base.o +0 -0
  106. data/lua-hooks/ext/luajit/src/lib_base_dyn.o +0 -0
  107. data/lua-hooks/ext/luajit/src/lib_bit.c +180 -0
  108. data/lua-hooks/ext/luajit/src/lib_bit.o +0 -0
  109. data/lua-hooks/ext/luajit/src/lib_bit_dyn.o +0 -0
  110. data/lua-hooks/ext/luajit/src/lib_debug.c +405 -0
  111. data/lua-hooks/ext/luajit/src/lib_debug.o +0 -0
  112. data/lua-hooks/ext/luajit/src/lib_debug_dyn.o +0 -0
  113. data/lua-hooks/ext/luajit/src/lib_ffi.c +872 -0
  114. data/lua-hooks/ext/luajit/src/lib_ffi.o +0 -0
  115. data/lua-hooks/ext/luajit/src/lib_ffi_dyn.o +0 -0
  116. data/lua-hooks/ext/luajit/src/lib_init.c +55 -0
  117. data/lua-hooks/ext/luajit/src/lib_init.o +0 -0
  118. data/lua-hooks/ext/luajit/src/lib_init_dyn.o +0 -0
  119. data/lua-hooks/ext/luajit/src/lib_io.c +541 -0
  120. data/lua-hooks/ext/luajit/src/lib_io.o +0 -0
  121. data/lua-hooks/ext/luajit/src/lib_io_dyn.o +0 -0
  122. data/lua-hooks/ext/luajit/src/lib_jit.c +767 -0
  123. data/lua-hooks/ext/luajit/src/lib_jit.o +0 -0
  124. data/lua-hooks/ext/luajit/src/lib_jit_dyn.o +0 -0
  125. data/lua-hooks/ext/luajit/src/lib_math.c +230 -0
  126. data/lua-hooks/ext/luajit/src/lib_math.o +0 -0
  127. data/lua-hooks/ext/luajit/src/lib_math_dyn.o +0 -0
  128. data/lua-hooks/ext/luajit/src/lib_os.c +292 -0
  129. data/lua-hooks/ext/luajit/src/lib_os.o +0 -0
  130. data/lua-hooks/ext/luajit/src/lib_os_dyn.o +0 -0
  131. data/lua-hooks/ext/luajit/src/lib_package.c +610 -0
  132. data/lua-hooks/ext/luajit/src/lib_package.o +0 -0
  133. data/lua-hooks/ext/luajit/src/lib_package_dyn.o +0 -0
  134. data/lua-hooks/ext/luajit/src/lib_string.c +752 -0
  135. data/lua-hooks/ext/luajit/src/lib_string.o +0 -0
  136. data/lua-hooks/ext/luajit/src/lib_string_dyn.o +0 -0
  137. data/lua-hooks/ext/luajit/src/lib_table.c +307 -0
  138. data/lua-hooks/ext/luajit/src/lib_table.o +0 -0
  139. data/lua-hooks/ext/luajit/src/lib_table_dyn.o +0 -0
  140. data/lua-hooks/ext/luajit/src/libluajit.a +0 -0
  141. data/lua-hooks/ext/luajit/src/libluajit.so +0 -0
  142. data/lua-hooks/ext/luajit/src/lj.supp +26 -0
  143. data/lua-hooks/ext/luajit/src/lj_alloc.c +1398 -0
  144. data/lua-hooks/ext/luajit/src/lj_alloc.h +17 -0
  145. data/lua-hooks/ext/luajit/src/lj_alloc.o +0 -0
  146. data/lua-hooks/ext/luajit/src/lj_alloc_dyn.o +0 -0
  147. data/lua-hooks/ext/luajit/src/lj_api.c +1210 -0
  148. data/lua-hooks/ext/luajit/src/lj_api.o +0 -0
  149. data/lua-hooks/ext/luajit/src/lj_api_dyn.o +0 -0
  150. data/lua-hooks/ext/luajit/src/lj_arch.h +509 -0
  151. data/lua-hooks/ext/luajit/src/lj_asm.c +2278 -0
  152. data/lua-hooks/ext/luajit/src/lj_asm.h +17 -0
  153. data/lua-hooks/ext/luajit/src/lj_asm.o +0 -0
  154. data/lua-hooks/ext/luajit/src/lj_asm_arm.h +2217 -0
  155. data/lua-hooks/ext/luajit/src/lj_asm_dyn.o +0 -0
  156. data/lua-hooks/ext/luajit/src/lj_asm_mips.h +1833 -0
  157. data/lua-hooks/ext/luajit/src/lj_asm_ppc.h +2015 -0
  158. data/lua-hooks/ext/luajit/src/lj_asm_x86.h +2634 -0
  159. data/lua-hooks/ext/luajit/src/lj_bc.c +14 -0
  160. data/lua-hooks/ext/luajit/src/lj_bc.h +265 -0
  161. data/lua-hooks/ext/luajit/src/lj_bc.o +0 -0
  162. data/lua-hooks/ext/luajit/src/lj_bc_dyn.o +0 -0
  163. data/lua-hooks/ext/luajit/src/lj_bcdef.h +220 -0
  164. data/lua-hooks/ext/luajit/src/lj_bcdump.h +68 -0
  165. data/lua-hooks/ext/luajit/src/lj_bcread.c +457 -0
  166. data/lua-hooks/ext/luajit/src/lj_bcread.o +0 -0
  167. data/lua-hooks/ext/luajit/src/lj_bcread_dyn.o +0 -0
  168. data/lua-hooks/ext/luajit/src/lj_bcwrite.c +361 -0
  169. data/lua-hooks/ext/luajit/src/lj_bcwrite.o +0 -0
  170. data/lua-hooks/ext/luajit/src/lj_bcwrite_dyn.o +0 -0
  171. data/lua-hooks/ext/luajit/src/lj_buf.c +234 -0
  172. data/lua-hooks/ext/luajit/src/lj_buf.h +105 -0
  173. data/lua-hooks/ext/luajit/src/lj_buf.o +0 -0
  174. data/lua-hooks/ext/luajit/src/lj_buf_dyn.o +0 -0
  175. data/lua-hooks/ext/luajit/src/lj_carith.c +429 -0
  176. data/lua-hooks/ext/luajit/src/lj_carith.h +37 -0
  177. data/lua-hooks/ext/luajit/src/lj_carith.o +0 -0
  178. data/lua-hooks/ext/luajit/src/lj_carith_dyn.o +0 -0
  179. data/lua-hooks/ext/luajit/src/lj_ccall.c +984 -0
  180. data/lua-hooks/ext/luajit/src/lj_ccall.h +178 -0
  181. data/lua-hooks/ext/luajit/src/lj_ccall.o +0 -0
  182. data/lua-hooks/ext/luajit/src/lj_ccall_dyn.o +0 -0
  183. data/lua-hooks/ext/luajit/src/lj_ccallback.c +712 -0
  184. data/lua-hooks/ext/luajit/src/lj_ccallback.h +25 -0
  185. data/lua-hooks/ext/luajit/src/lj_ccallback.o +0 -0
  186. data/lua-hooks/ext/luajit/src/lj_ccallback_dyn.o +0 -0
  187. data/lua-hooks/ext/luajit/src/lj_cconv.c +752 -0
  188. data/lua-hooks/ext/luajit/src/lj_cconv.h +70 -0
  189. data/lua-hooks/ext/luajit/src/lj_cconv.o +0 -0
  190. data/lua-hooks/ext/luajit/src/lj_cconv_dyn.o +0 -0
  191. data/lua-hooks/ext/luajit/src/lj_cdata.c +288 -0
  192. data/lua-hooks/ext/luajit/src/lj_cdata.h +76 -0
  193. data/lua-hooks/ext/luajit/src/lj_cdata.o +0 -0
  194. data/lua-hooks/ext/luajit/src/lj_cdata_dyn.o +0 -0
  195. data/lua-hooks/ext/luajit/src/lj_char.c +43 -0
  196. data/lua-hooks/ext/luajit/src/lj_char.h +42 -0
  197. data/lua-hooks/ext/luajit/src/lj_char.o +0 -0
  198. data/lua-hooks/ext/luajit/src/lj_char_dyn.o +0 -0
  199. data/lua-hooks/ext/luajit/src/lj_clib.c +418 -0
  200. data/lua-hooks/ext/luajit/src/lj_clib.h +29 -0
  201. data/lua-hooks/ext/luajit/src/lj_clib.o +0 -0
  202. data/lua-hooks/ext/luajit/src/lj_clib_dyn.o +0 -0
  203. data/lua-hooks/ext/luajit/src/lj_cparse.c +1862 -0
  204. data/lua-hooks/ext/luajit/src/lj_cparse.h +65 -0
  205. data/lua-hooks/ext/luajit/src/lj_cparse.o +0 -0
  206. data/lua-hooks/ext/luajit/src/lj_cparse_dyn.o +0 -0
  207. data/lua-hooks/ext/luajit/src/lj_crecord.c +1834 -0
  208. data/lua-hooks/ext/luajit/src/lj_crecord.h +38 -0
  209. data/lua-hooks/ext/luajit/src/lj_crecord.o +0 -0
  210. data/lua-hooks/ext/luajit/src/lj_crecord_dyn.o +0 -0
  211. data/lua-hooks/ext/luajit/src/lj_ctype.c +635 -0
  212. data/lua-hooks/ext/luajit/src/lj_ctype.h +461 -0
  213. data/lua-hooks/ext/luajit/src/lj_ctype.o +0 -0
  214. data/lua-hooks/ext/luajit/src/lj_ctype_dyn.o +0 -0
  215. data/lua-hooks/ext/luajit/src/lj_debug.c +699 -0
  216. data/lua-hooks/ext/luajit/src/lj_debug.h +65 -0
  217. data/lua-hooks/ext/luajit/src/lj_debug.o +0 -0
  218. data/lua-hooks/ext/luajit/src/lj_debug_dyn.o +0 -0
  219. data/lua-hooks/ext/luajit/src/lj_def.h +365 -0
  220. data/lua-hooks/ext/luajit/src/lj_dispatch.c +557 -0
  221. data/lua-hooks/ext/luajit/src/lj_dispatch.h +138 -0
  222. data/lua-hooks/ext/luajit/src/lj_dispatch.o +0 -0
  223. data/lua-hooks/ext/luajit/src/lj_dispatch_dyn.o +0 -0
  224. data/lua-hooks/ext/luajit/src/lj_emit_arm.h +356 -0
  225. data/lua-hooks/ext/luajit/src/lj_emit_mips.h +211 -0
  226. data/lua-hooks/ext/luajit/src/lj_emit_ppc.h +238 -0
  227. data/lua-hooks/ext/luajit/src/lj_emit_x86.h +462 -0
  228. data/lua-hooks/ext/luajit/src/lj_err.c +794 -0
  229. data/lua-hooks/ext/luajit/src/lj_err.h +41 -0
  230. data/lua-hooks/ext/luajit/src/lj_err.o +0 -0
  231. data/lua-hooks/ext/luajit/src/lj_err_dyn.o +0 -0
  232. data/lua-hooks/ext/luajit/src/lj_errmsg.h +190 -0
  233. data/lua-hooks/ext/luajit/src/lj_ff.h +18 -0
  234. data/lua-hooks/ext/luajit/src/lj_ffdef.h +209 -0
  235. data/lua-hooks/ext/luajit/src/lj_ffrecord.c +1247 -0
  236. data/lua-hooks/ext/luajit/src/lj_ffrecord.h +24 -0
  237. data/lua-hooks/ext/luajit/src/lj_ffrecord.o +0 -0
  238. data/lua-hooks/ext/luajit/src/lj_ffrecord_dyn.o +0 -0
  239. data/lua-hooks/ext/luajit/src/lj_folddef.h +1138 -0
  240. data/lua-hooks/ext/luajit/src/lj_frame.h +259 -0
  241. data/lua-hooks/ext/luajit/src/lj_func.c +185 -0
  242. data/lua-hooks/ext/luajit/src/lj_func.h +24 -0
  243. data/lua-hooks/ext/luajit/src/lj_func.o +0 -0
  244. data/lua-hooks/ext/luajit/src/lj_func_dyn.o +0 -0
  245. data/lua-hooks/ext/luajit/src/lj_gc.c +845 -0
  246. data/lua-hooks/ext/luajit/src/lj_gc.h +134 -0
  247. data/lua-hooks/ext/luajit/src/lj_gc.o +0 -0
  248. data/lua-hooks/ext/luajit/src/lj_gc_dyn.o +0 -0
  249. data/lua-hooks/ext/luajit/src/lj_gdbjit.c +787 -0
  250. data/lua-hooks/ext/luajit/src/lj_gdbjit.h +22 -0
  251. data/lua-hooks/ext/luajit/src/lj_gdbjit.o +0 -0
  252. data/lua-hooks/ext/luajit/src/lj_gdbjit_dyn.o +0 -0
  253. data/lua-hooks/ext/luajit/src/lj_ir.c +505 -0
  254. data/lua-hooks/ext/luajit/src/lj_ir.h +577 -0
  255. data/lua-hooks/ext/luajit/src/lj_ir.o +0 -0
  256. data/lua-hooks/ext/luajit/src/lj_ir_dyn.o +0 -0
  257. data/lua-hooks/ext/luajit/src/lj_ircall.h +321 -0
  258. data/lua-hooks/ext/luajit/src/lj_iropt.h +161 -0
  259. data/lua-hooks/ext/luajit/src/lj_jit.h +440 -0
  260. data/lua-hooks/ext/luajit/src/lj_lex.c +482 -0
  261. data/lua-hooks/ext/luajit/src/lj_lex.h +86 -0
  262. data/lua-hooks/ext/luajit/src/lj_lex.o +0 -0
  263. data/lua-hooks/ext/luajit/src/lj_lex_dyn.o +0 -0
  264. data/lua-hooks/ext/luajit/src/lj_lib.c +303 -0
  265. data/lua-hooks/ext/luajit/src/lj_lib.h +115 -0
  266. data/lua-hooks/ext/luajit/src/lj_lib.o +0 -0
  267. data/lua-hooks/ext/luajit/src/lj_lib_dyn.o +0 -0
  268. data/lua-hooks/ext/luajit/src/lj_libdef.h +414 -0
  269. data/lua-hooks/ext/luajit/src/lj_load.c +168 -0
  270. data/lua-hooks/ext/luajit/src/lj_load.o +0 -0
  271. data/lua-hooks/ext/luajit/src/lj_load_dyn.o +0 -0
  272. data/lua-hooks/ext/luajit/src/lj_mcode.c +386 -0
  273. data/lua-hooks/ext/luajit/src/lj_mcode.h +30 -0
  274. data/lua-hooks/ext/luajit/src/lj_mcode.o +0 -0
  275. data/lua-hooks/ext/luajit/src/lj_mcode_dyn.o +0 -0
  276. data/lua-hooks/ext/luajit/src/lj_meta.c +477 -0
  277. data/lua-hooks/ext/luajit/src/lj_meta.h +38 -0
  278. data/lua-hooks/ext/luajit/src/lj_meta.o +0 -0
  279. data/lua-hooks/ext/luajit/src/lj_meta_dyn.o +0 -0
  280. data/lua-hooks/ext/luajit/src/lj_obj.c +50 -0
  281. data/lua-hooks/ext/luajit/src/lj_obj.h +976 -0
  282. data/lua-hooks/ext/luajit/src/lj_obj.o +0 -0
  283. data/lua-hooks/ext/luajit/src/lj_obj_dyn.o +0 -0
  284. data/lua-hooks/ext/luajit/src/lj_opt_dce.c +78 -0
  285. data/lua-hooks/ext/luajit/src/lj_opt_dce.o +0 -0
  286. data/lua-hooks/ext/luajit/src/lj_opt_dce_dyn.o +0 -0
  287. data/lua-hooks/ext/luajit/src/lj_opt_fold.c +2488 -0
  288. data/lua-hooks/ext/luajit/src/lj_opt_fold.o +0 -0
  289. data/lua-hooks/ext/luajit/src/lj_opt_fold_dyn.o +0 -0
  290. data/lua-hooks/ext/luajit/src/lj_opt_loop.c +449 -0
  291. data/lua-hooks/ext/luajit/src/lj_opt_loop.o +0 -0
  292. data/lua-hooks/ext/luajit/src/lj_opt_loop_dyn.o +0 -0
  293. data/lua-hooks/ext/luajit/src/lj_opt_mem.c +935 -0
  294. data/lua-hooks/ext/luajit/src/lj_opt_mem.o +0 -0
  295. data/lua-hooks/ext/luajit/src/lj_opt_mem_dyn.o +0 -0
  296. data/lua-hooks/ext/luajit/src/lj_opt_narrow.c +652 -0
  297. data/lua-hooks/ext/luajit/src/lj_opt_narrow.o +0 -0
  298. data/lua-hooks/ext/luajit/src/lj_opt_narrow_dyn.o +0 -0
  299. data/lua-hooks/ext/luajit/src/lj_opt_sink.c +245 -0
  300. data/lua-hooks/ext/luajit/src/lj_opt_sink.o +0 -0
  301. data/lua-hooks/ext/luajit/src/lj_opt_sink_dyn.o +0 -0
  302. data/lua-hooks/ext/luajit/src/lj_opt_split.c +856 -0
  303. data/lua-hooks/ext/luajit/src/lj_opt_split.o +0 -0
  304. data/lua-hooks/ext/luajit/src/lj_opt_split_dyn.o +0 -0
  305. data/lua-hooks/ext/luajit/src/lj_parse.c +2725 -0
  306. data/lua-hooks/ext/luajit/src/lj_parse.h +18 -0
  307. data/lua-hooks/ext/luajit/src/lj_parse.o +0 -0
  308. data/lua-hooks/ext/luajit/src/lj_parse_dyn.o +0 -0
  309. data/lua-hooks/ext/luajit/src/lj_profile.c +368 -0
  310. data/lua-hooks/ext/luajit/src/lj_profile.h +21 -0
  311. data/lua-hooks/ext/luajit/src/lj_profile.o +0 -0
  312. data/lua-hooks/ext/luajit/src/lj_profile_dyn.o +0 -0
  313. data/lua-hooks/ext/luajit/src/lj_recdef.h +270 -0
  314. data/lua-hooks/ext/luajit/src/lj_record.c +2554 -0
  315. data/lua-hooks/ext/luajit/src/lj_record.h +45 -0
  316. data/lua-hooks/ext/luajit/src/lj_record.o +0 -0
  317. data/lua-hooks/ext/luajit/src/lj_record_dyn.o +0 -0
  318. data/lua-hooks/ext/luajit/src/lj_snap.c +870 -0
  319. data/lua-hooks/ext/luajit/src/lj_snap.h +34 -0
  320. data/lua-hooks/ext/luajit/src/lj_snap.o +0 -0
  321. data/lua-hooks/ext/luajit/src/lj_snap_dyn.o +0 -0
  322. data/lua-hooks/ext/luajit/src/lj_state.c +300 -0
  323. data/lua-hooks/ext/luajit/src/lj_state.h +35 -0
  324. data/lua-hooks/ext/luajit/src/lj_state.o +0 -0
  325. data/lua-hooks/ext/luajit/src/lj_state_dyn.o +0 -0
  326. data/lua-hooks/ext/luajit/src/lj_str.c +197 -0
  327. data/lua-hooks/ext/luajit/src/lj_str.h +27 -0
  328. data/lua-hooks/ext/luajit/src/lj_str.o +0 -0
  329. data/lua-hooks/ext/luajit/src/lj_str_dyn.o +0 -0
  330. data/lua-hooks/ext/luajit/src/lj_strfmt.c +554 -0
  331. data/lua-hooks/ext/luajit/src/lj_strfmt.h +125 -0
  332. data/lua-hooks/ext/luajit/src/lj_strfmt.o +0 -0
  333. data/lua-hooks/ext/luajit/src/lj_strfmt_dyn.o +0 -0
  334. data/lua-hooks/ext/luajit/src/lj_strscan.c +547 -0
  335. data/lua-hooks/ext/luajit/src/lj_strscan.h +39 -0
  336. data/lua-hooks/ext/luajit/src/lj_strscan.o +0 -0
  337. data/lua-hooks/ext/luajit/src/lj_strscan_dyn.o +0 -0
  338. data/lua-hooks/ext/luajit/src/lj_tab.c +666 -0
  339. data/lua-hooks/ext/luajit/src/lj_tab.h +73 -0
  340. data/lua-hooks/ext/luajit/src/lj_tab.o +0 -0
  341. data/lua-hooks/ext/luajit/src/lj_tab_dyn.o +0 -0
  342. data/lua-hooks/ext/luajit/src/lj_target.h +164 -0
  343. data/lua-hooks/ext/luajit/src/lj_target_arm.h +270 -0
  344. data/lua-hooks/ext/luajit/src/lj_target_arm64.h +97 -0
  345. data/lua-hooks/ext/luajit/src/lj_target_mips.h +260 -0
  346. data/lua-hooks/ext/luajit/src/lj_target_ppc.h +280 -0
  347. data/lua-hooks/ext/luajit/src/lj_target_x86.h +345 -0
  348. data/lua-hooks/ext/luajit/src/lj_trace.c +859 -0
  349. data/lua-hooks/ext/luajit/src/lj_trace.h +54 -0
  350. data/lua-hooks/ext/luajit/src/lj_trace.o +0 -0
  351. data/lua-hooks/ext/luajit/src/lj_trace_dyn.o +0 -0
  352. data/lua-hooks/ext/luajit/src/lj_traceerr.h +63 -0
  353. data/lua-hooks/ext/luajit/src/lj_udata.c +34 -0
  354. data/lua-hooks/ext/luajit/src/lj_udata.h +14 -0
  355. data/lua-hooks/ext/luajit/src/lj_udata.o +0 -0
  356. data/lua-hooks/ext/luajit/src/lj_udata_dyn.o +0 -0
  357. data/lua-hooks/ext/luajit/src/lj_vm.S +2730 -0
  358. data/lua-hooks/ext/luajit/src/lj_vm.h +114 -0
  359. data/lua-hooks/ext/luajit/src/lj_vm.o +0 -0
  360. data/lua-hooks/ext/luajit/src/lj_vm_dyn.o +0 -0
  361. data/lua-hooks/ext/luajit/src/lj_vmevent.c +58 -0
  362. data/lua-hooks/ext/luajit/src/lj_vmevent.h +59 -0
  363. data/lua-hooks/ext/luajit/src/lj_vmevent.o +0 -0
  364. data/lua-hooks/ext/luajit/src/lj_vmevent_dyn.o +0 -0
  365. data/lua-hooks/ext/luajit/src/lj_vmmath.c +152 -0
  366. data/lua-hooks/ext/luajit/src/lj_vmmath.o +0 -0
  367. data/lua-hooks/ext/luajit/src/lj_vmmath_dyn.o +0 -0
  368. data/lua-hooks/ext/luajit/src/ljamalg.c +96 -0
  369. data/lua-hooks/ext/{lua → luajit/src}/lua.h +12 -7
  370. data/lua-hooks/ext/luajit/src/lua.hpp +9 -0
  371. data/lua-hooks/ext/luajit/src/luaconf.h +156 -0
  372. data/lua-hooks/ext/luajit/src/luajit +0 -0
  373. data/lua-hooks/ext/luajit/src/luajit.c +570 -0
  374. data/lua-hooks/ext/luajit/src/luajit.h +79 -0
  375. data/lua-hooks/ext/luajit/src/luajit.o +0 -0
  376. data/lua-hooks/ext/luajit/src/lualib.h +43 -0
  377. data/lua-hooks/ext/luajit/src/msvcbuild.bat +114 -0
  378. data/lua-hooks/ext/luajit/src/ps4build.bat +103 -0
  379. data/lua-hooks/ext/luajit/src/psvitabuild.bat +93 -0
  380. data/lua-hooks/ext/luajit/src/vm_arm.dasc +4585 -0
  381. data/lua-hooks/ext/luajit/src/vm_arm64.dasc +3764 -0
  382. data/lua-hooks/ext/luajit/src/vm_mips.dasc +4355 -0
  383. data/lua-hooks/ext/luajit/src/vm_ppc.dasc +5252 -0
  384. data/lua-hooks/ext/luajit/src/vm_x64.dasc +4902 -0
  385. data/lua-hooks/ext/luajit/src/vm_x86.dasc +5710 -0
  386. data/lua-hooks/ext/luajit/src/xb1build.bat +101 -0
  387. data/lua-hooks/ext/luajit/src/xedkbuild.bat +92 -0
  388. data/lua-hooks/ext/luautf8/lutf8lib.c +3 -3
  389. data/lua-hooks/lib/boot.lua +37 -2
  390. metadata +372 -69
  391. data/lua-hooks/ext/bitop/README +0 -22
  392. data/lua-hooks/ext/bitop/bit.c +0 -189
  393. data/lua-hooks/ext/extconf.rb +0 -38
  394. data/lua-hooks/ext/lua/COPYRIGHT +0 -34
  395. data/lua-hooks/ext/lua/lapi.c +0 -1087
  396. data/lua-hooks/ext/lua/lapi.h +0 -16
  397. data/lua-hooks/ext/lua/lauxlib.c +0 -652
  398. data/lua-hooks/ext/lua/lbaselib.c +0 -659
  399. data/lua-hooks/ext/lua/lcode.c +0 -831
  400. data/lua-hooks/ext/lua/lcode.h +0 -76
  401. data/lua-hooks/ext/lua/ldblib.c +0 -398
  402. data/lua-hooks/ext/lua/ldebug.c +0 -638
  403. data/lua-hooks/ext/lua/ldebug.h +0 -33
  404. data/lua-hooks/ext/lua/ldo.c +0 -519
  405. data/lua-hooks/ext/lua/ldo.h +0 -57
  406. data/lua-hooks/ext/lua/ldump.c +0 -164
  407. data/lua-hooks/ext/lua/lfunc.c +0 -174
  408. data/lua-hooks/ext/lua/lfunc.h +0 -34
  409. data/lua-hooks/ext/lua/lgc.c +0 -710
  410. data/lua-hooks/ext/lua/lgc.h +0 -110
  411. data/lua-hooks/ext/lua/linit.c +0 -38
  412. data/lua-hooks/ext/lua/liolib.c +0 -556
  413. data/lua-hooks/ext/lua/llex.c +0 -463
  414. data/lua-hooks/ext/lua/llex.h +0 -81
  415. data/lua-hooks/ext/lua/llimits.h +0 -128
  416. data/lua-hooks/ext/lua/lmathlib.c +0 -263
  417. data/lua-hooks/ext/lua/lmem.c +0 -86
  418. data/lua-hooks/ext/lua/lmem.h +0 -49
  419. data/lua-hooks/ext/lua/loadlib.c +0 -705
  420. data/lua-hooks/ext/lua/loadlib_rel.c +0 -760
  421. data/lua-hooks/ext/lua/lobject.c +0 -214
  422. data/lua-hooks/ext/lua/lobject.h +0 -381
  423. data/lua-hooks/ext/lua/lopcodes.c +0 -102
  424. data/lua-hooks/ext/lua/lopcodes.h +0 -268
  425. data/lua-hooks/ext/lua/loslib.c +0 -243
  426. data/lua-hooks/ext/lua/lparser.c +0 -1339
  427. data/lua-hooks/ext/lua/lparser.h +0 -82
  428. data/lua-hooks/ext/lua/lstate.c +0 -214
  429. data/lua-hooks/ext/lua/lstate.h +0 -169
  430. data/lua-hooks/ext/lua/lstring.c +0 -111
  431. data/lua-hooks/ext/lua/lstring.h +0 -31
  432. data/lua-hooks/ext/lua/lstrlib.c +0 -871
  433. data/lua-hooks/ext/lua/ltable.c +0 -588
  434. data/lua-hooks/ext/lua/ltable.h +0 -40
  435. data/lua-hooks/ext/lua/ltablib.c +0 -287
  436. data/lua-hooks/ext/lua/ltm.c +0 -75
  437. data/lua-hooks/ext/lua/ltm.h +0 -54
  438. data/lua-hooks/ext/lua/lua.c +0 -392
  439. data/lua-hooks/ext/lua/lua.def +0 -131
  440. data/lua-hooks/ext/lua/lua.rc +0 -28
  441. data/lua-hooks/ext/lua/lua_dll.rc +0 -26
  442. data/lua-hooks/ext/lua/luac.c +0 -200
  443. data/lua-hooks/ext/lua/luac.rc +0 -1
  444. data/lua-hooks/ext/lua/luaconf.h +0 -763
  445. data/lua-hooks/ext/lua/luaconf.h.in +0 -724
  446. data/lua-hooks/ext/lua/luaconf.h.orig +0 -763
  447. data/lua-hooks/ext/lua/lualib.h +0 -53
  448. data/lua-hooks/ext/lua/lundump.c +0 -227
  449. data/lua-hooks/ext/lua/lundump.h +0 -36
  450. data/lua-hooks/ext/lua/lvm.c +0 -767
  451. data/lua-hooks/ext/lua/lvm.h +0 -36
  452. data/lua-hooks/ext/lua/lzio.c +0 -82
  453. data/lua-hooks/ext/lua/lzio.h +0 -67
  454. data/lua-hooks/ext/lua/print.c +0 -227
@@ -0,0 +1,659 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html>
3
+ <head>
4
+ <title>Installation</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
+ <meta name="Author" content="Mike Pall">
7
+ <meta name="Copyright" content="Copyright (C) 2005-2015, Mike Pall">
8
+ <meta name="Language" content="en">
9
+ <link rel="stylesheet" type="text/css" href="bluequad.css" media="screen">
10
+ <link rel="stylesheet" type="text/css" href="bluequad-print.css" media="print">
11
+ <style type="text/css">
12
+ table.compat {
13
+ line-height: 1.2;
14
+ font-size: 80%;
15
+ }
16
+ table.compat td {
17
+ border: 1px solid #bfcfff;
18
+ height: 2.5em;
19
+ }
20
+ table.compat tr.compathead td {
21
+ font-weight: bold;
22
+ border-bottom: 2px solid #bfcfff;
23
+ }
24
+ tr.compathead td.compatos {
25
+ vertical-align: top;
26
+ }
27
+ table.compat td.compatcpu {
28
+ width: 18%;
29
+ border-right: 2px solid #bfcfff;
30
+ }
31
+ td.compatos {
32
+ width: 21%;
33
+ vertical-align: middle;
34
+ }
35
+ td.compatno {
36
+ background-color: #d0d0d0;
37
+ }
38
+ </style>
39
+ </head>
40
+ <body>
41
+ <div id="site">
42
+ <a href="http://luajit.org"><span>Lua<span id="logo">JIT</span></span></a>
43
+ </div>
44
+ <div id="head">
45
+ <h1>Installation</h1>
46
+ </div>
47
+ <div id="nav">
48
+ <ul><li>
49
+ <a href="luajit.html">LuaJIT</a>
50
+ <ul><li>
51
+ <a href="http://luajit.org/download.html">Download <span class="ext">&raquo;</span></a>
52
+ </li><li>
53
+ <a class="current" href="install.html">Installation</a>
54
+ </li><li>
55
+ <a href="running.html">Running</a>
56
+ </li></ul>
57
+ </li><li>
58
+ <a href="extensions.html">Extensions</a>
59
+ <ul><li>
60
+ <a href="ext_ffi.html">FFI Library</a>
61
+ <ul><li>
62
+ <a href="ext_ffi_tutorial.html">FFI Tutorial</a>
63
+ </li><li>
64
+ <a href="ext_ffi_api.html">ffi.* API</a>
65
+ </li><li>
66
+ <a href="ext_ffi_semantics.html">FFI Semantics</a>
67
+ </li></ul>
68
+ </li><li>
69
+ <a href="ext_jit.html">jit.* Library</a>
70
+ </li><li>
71
+ <a href="ext_c_api.html">Lua/C API</a>
72
+ </li><li>
73
+ <a href="ext_profiler.html">Profiler</a>
74
+ </li></ul>
75
+ </li><li>
76
+ <a href="status.html">Status</a>
77
+ <ul><li>
78
+ <a href="changes.html">Changes</a>
79
+ </li></ul>
80
+ </li><li>
81
+ <a href="faq.html">FAQ</a>
82
+ </li><li>
83
+ <a href="http://luajit.org/performance.html">Performance <span class="ext">&raquo;</span></a>
84
+ </li><li>
85
+ <a href="http://wiki.luajit.org/">Wiki <span class="ext">&raquo;</span></a>
86
+ </li><li>
87
+ <a href="http://luajit.org/list.html">Mailing List <span class="ext">&raquo;</span></a>
88
+ </li></ul>
89
+ </div>
90
+ <div id="main">
91
+ <p>
92
+ LuaJIT is only distributed as a source package. This page explains
93
+ how to build and install LuaJIT with different operating systems
94
+ and C&nbsp;compilers.
95
+ </p>
96
+ <p>
97
+ For the impatient (on POSIX systems):
98
+ </p>
99
+ <pre class="code">
100
+ make &amp;&amp; sudo make install
101
+ </pre>
102
+ <p>
103
+ LuaJIT currently builds out-of-the box on most systems.
104
+ Here's the compatibility matrix for the supported combinations of
105
+ operating systems, CPUs and compilers:
106
+ </p>
107
+ <table class="compat">
108
+ <tr class="compathead">
109
+ <td class="compatcpu">CPU / OS</td>
110
+ <td class="compatos"><a href="#posix">Linux</a> or<br><a href="#android">Android</a></td>
111
+ <td class="compatos"><a href="#posix">*BSD, Other</a></td>
112
+ <td class="compatos"><a href="#posix">OSX 10.4+</a> or<br><a href="#ios">iOS 3.0+</a></td>
113
+ <td class="compatos"><a href="#windows">Windows<br>XP/Vista/7</a></td>
114
+ </tr>
115
+ <tr class="odd separate">
116
+ <td class="compatcpu">x86 (32 bit)</td>
117
+ <td class="compatos">GCC 4.x<br>GCC 3.4</td>
118
+ <td class="compatos">GCC 4.x<br>GCC 3.4</td>
119
+ <td class="compatos">GCC 4.x<br>GCC 3.4</td>
120
+ <td class="compatos">MSVC, MSVC/EE<br>WinSDK<br>MinGW, Cygwin</td>
121
+ </tr>
122
+ <tr class="even">
123
+ <td class="compatcpu">x64 (64 bit)</td>
124
+ <td class="compatos">GCC 4.x</td>
125
+ <td class="compatos">ORBIS (<a href="#ps4">PS4</a>)</td>
126
+ <td class="compatos">GCC 4.x</td>
127
+ <td class="compatos">MSVC + SDK v7.0<br>WinSDK v7.0<br>Durango (<a href="#xboxone">Xbox One</a>)</td>
128
+ </tr>
129
+ <tr class="odd">
130
+ <td class="compatcpu"><a href="#cross2">ARMv5+<br>ARM9E+</a></td>
131
+ <td class="compatos">GCC 4.2+</td>
132
+ <td class="compatos">GCC 4.2+<br>PSP2 (<a href="#psvita">PS VITA</a>)</td>
133
+ <td class="compatos">GCC 4.2+</td>
134
+ <td class="compatos compatno">&nbsp;</td>
135
+ </tr>
136
+ <tr class="even">
137
+ <td class="compatcpu"><a href="#cross2">ARM64</a></td>
138
+ <td class="compatos">GCC 4.8+</td>
139
+ <td class="compatos compatno">&nbsp;</td>
140
+ <td class="compatos">Clang 3.5+</td>
141
+ <td class="compatos compatno">&nbsp;</td>
142
+ </tr>
143
+ <tr class="odd">
144
+ <td class="compatcpu"><a href="#cross2">PPC</a></td>
145
+ <td class="compatos">GCC 4.3+</td>
146
+ <td class="compatos">GCC 4.3+<br>GCC 4.1 (<a href="#ps3">PS3</a>)</td>
147
+ <td class="compatos compatno">&nbsp;</td>
148
+ <td class="compatos">XEDK (<a href="#xbox360">Xbox 360</a>)</td>
149
+ </tr>
150
+ <tr class="even">
151
+ <td class="compatcpu"><a href="#cross2">MIPS</a></td>
152
+ <td class="compatos">GCC 4.3+</td>
153
+ <td class="compatos">GCC 4.3+</td>
154
+ <td class="compatos compatno">&nbsp;</td>
155
+ <td class="compatos compatno">&nbsp;</td>
156
+ </tr>
157
+ </table>
158
+
159
+ <h2>Configuring LuaJIT</h2>
160
+ <p>
161
+ The standard configuration should work fine for most installations.
162
+ Usually there is no need to tweak the settings. The following files
163
+ hold all user-configurable settings:
164
+ </p>
165
+ <ul>
166
+ <li><tt>src/luaconf.h</tt> sets some configuration variables.</li>
167
+ <li><tt>Makefile</tt> has settings for <b>installing</b> LuaJIT (POSIX
168
+ only).</li>
169
+ <li><tt>src/Makefile</tt> has settings for <b>compiling</b> LuaJIT
170
+ under POSIX, MinGW or Cygwin.</li>
171
+ <li><tt>src/msvcbuild.bat</tt> has settings for compiling LuaJIT with
172
+ MSVC or WinSDK.</li>
173
+ </ul>
174
+ <p>
175
+ Please read the instructions given in these files, before changing
176
+ any settings.
177
+ </p>
178
+
179
+ <h2 id="posix">POSIX Systems (Linux, OSX, *BSD etc.)</h2>
180
+ <h3>Prerequisites</h3>
181
+ <p>
182
+ Depending on your distribution, you may need to install a package for
183
+ GCC, the development headers and/or a complete SDK. E.g. on a current
184
+ Debian/Ubuntu, install <tt>libc6-dev</tt> with the package manager.
185
+ </p>
186
+ <p>
187
+ Download the current source package of LuaJIT (pick the .tar.gz),
188
+ if you haven't already done so. Move it to a directory of your choice,
189
+ open a terminal window and change to this directory. Now unpack the archive
190
+ and change to the newly created directory:
191
+ </p>
192
+ <pre class="code">
193
+ tar zxf LuaJIT-2.0.4.tar.gz
194
+ cd LuaJIT-2.0.4</pre>
195
+ <h3>Building LuaJIT</h3>
196
+ <p>
197
+ The supplied Makefiles try to auto-detect the settings needed for your
198
+ operating system and your compiler. They need to be run with GNU Make,
199
+ which is probably the default on your system, anyway. Simply run:
200
+ </p>
201
+ <pre class="code">
202
+ make
203
+ </pre>
204
+ <p>
205
+ This always builds a native x86, x64 or PPC binary, depending on the host OS
206
+ you're running this command on. Check the section on
207
+ <a href="#cross">cross-compilation</a> for more options.
208
+ </p>
209
+ <p>
210
+ By default, modules are only searched under the prefix <tt>/usr/local</tt>.
211
+ You can add an extra prefix to the search paths by appending the
212
+ <tt>PREFIX</tt> option, e.g.:
213
+ </p>
214
+ <pre class="code">
215
+ make PREFIX=/home/myself/lj2
216
+ </pre>
217
+ <p>
218
+ Note for OSX: if the <tt>MACOSX_DEPLOYMENT_TARGET</tt> environment
219
+ variable is not set, then it's forced to <tt>10.4</tt>.
220
+ </p>
221
+ <h3>Installing LuaJIT</h3>
222
+ <p>
223
+ The top-level Makefile installs LuaJIT by default under
224
+ <tt>/usr/local</tt>, i.e. the executable ends up in
225
+ <tt>/usr/local/bin</tt> and so on. You need root privileges
226
+ to write to this path. So, assuming sudo is installed on your system,
227
+ run the following command and enter your sudo password:
228
+ </p>
229
+ <pre class="code">
230
+ sudo make install
231
+ </pre>
232
+ <p>
233
+ Otherwise specify the directory prefix as an absolute path, e.g.:
234
+ </p>
235
+ <pre class="code">
236
+ make install PREFIX=/home/myself/lj2
237
+ </pre>
238
+ <p>
239
+ Obviously the prefixes given during build and installation need to be the same.
240
+ </p>
241
+
242
+ <h2 id="windows">Windows Systems</h2>
243
+ <h3>Prerequisites</h3>
244
+ <p>
245
+ Either install one of the open source SDKs
246
+ (<a href="http://mingw.org/"><span class="ext">&raquo;</span>&nbsp;MinGW</a> or
247
+ <a href="http://www.cygwin.com/"><span class="ext">&raquo;</span>&nbsp;Cygwin</a>), which come with a modified
248
+ GCC plus the required development headers.
249
+ </p>
250
+ <p>
251
+ Or install Microsoft's Visual C++ (MSVC). The freely downloadable
252
+ <a href="http://www.microsoft.com/Express/VC/"><span class="ext">&raquo;</span>&nbsp;Express Edition</a>
253
+ works just fine, but only contains an x86 compiler.
254
+ </p>
255
+ <p>
256
+ The freely downloadable
257
+ <a href="http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx"><span class="ext">&raquo;</span>&nbsp;Windows SDK</a>
258
+ only comes with command line tools, but this is all you need to build LuaJIT.
259
+ It contains x86 and x64 compilers.
260
+ </p>
261
+ <p>
262
+ Next, download the source package and unpack it using an archive manager
263
+ (e.g. the Windows Explorer) to a directory of your choice.
264
+ </p>
265
+ <h3>Building with MSVC</h3>
266
+ <p>
267
+ Open a "Visual Studio .NET Command Prompt", <tt>cd</tt> to the
268
+ directory where you've unpacked the sources and run these commands:
269
+ </p>
270
+ <pre class="code">
271
+ cd src
272
+ msvcbuild
273
+ </pre>
274
+ <p>
275
+ Then follow the installation instructions below.
276
+ </p>
277
+ <h3>Building with the Windows SDK</h3>
278
+ <p>
279
+ Open a "Windows SDK Command Shell" and select the x86 compiler:
280
+ </p>
281
+ <pre class="code">
282
+ setenv /release /x86
283
+ </pre>
284
+ <p>
285
+ Or select the x64 compiler:
286
+ </p>
287
+ <pre class="code">
288
+ setenv /release /x64
289
+ </pre>
290
+ <p>
291
+ Then <tt>cd</tt> to the directory where you've unpacked the sources
292
+ and run these commands:
293
+ </p>
294
+ <pre class="code">
295
+ cd src
296
+ msvcbuild
297
+ </pre>
298
+ <p>
299
+ Then follow the installation instructions below.
300
+ </p>
301
+ <h3>Building with MinGW or Cygwin</h3>
302
+ <p>
303
+ Open a command prompt window and make sure the MinGW or Cygwin programs
304
+ are in your path. Then <tt>cd</tt> to the directory where
305
+ you've unpacked the sources and run this command for MinGW:
306
+ </p>
307
+ <pre class="code">
308
+ mingw32-make
309
+ </pre>
310
+ <p>
311
+ Or this command for Cygwin:
312
+ </p>
313
+ <pre class="code">
314
+ make
315
+ </pre>
316
+ <p>
317
+ Then follow the installation instructions below.
318
+ </p>
319
+ <h3>Installing LuaJIT</h3>
320
+ <p>
321
+ Copy <tt>luajit.exe</tt> and <tt>lua51.dll</tt> (built in the <tt>src</tt>
322
+ directory) to a newly created directory (any location is ok).
323
+ Add <tt>lua</tt> and <tt>lua\jit</tt> directories below it and copy
324
+ all Lua files from the <tt>src\jit</tt> directory of the distribution
325
+ to the latter directory.
326
+ </p>
327
+ <p>
328
+ There are no hardcoded
329
+ absolute path names &mdash; all modules are loaded relative to the
330
+ directory where <tt>luajit.exe</tt> is installed
331
+ (see <tt>src/luaconf.h</tt>).
332
+ </p>
333
+
334
+ <h2 id="cross">Cross-compiling LuaJIT</h2>
335
+ <p>
336
+ The GNU Makefile-based build system allows cross-compiling on any host
337
+ for any supported target, as long as both architectures have the same
338
+ pointer size. If you want to cross-compile to any 32 bit target on an
339
+ x64 OS, you need to install the multilib development package (e.g.
340
+ <tt>libc6-dev-i386</tt> on Debian/Ubuntu) and build a 32 bit host part
341
+ (<tt>HOST_CC="gcc -m32"</tt>).
342
+ </p>
343
+ <p>
344
+ You need to specify <tt>TARGET_SYS</tt> whenever the host OS and the
345
+ target OS differ, or you'll get assembler or linker errors. E.g. if
346
+ you're compiling on a Windows or OSX host for embedded Linux or Android,
347
+ you need to add <tt>TARGET_SYS=Linux</tt> to the examples below. For a
348
+ minimal target OS, you may need to disable the built-in allocator in
349
+ <tt>src/Makefile</tt> and use <tt>TARGET_SYS=Other</tt>. The examples
350
+ below only show some popular targets &mdash; please check the comments
351
+ in <tt>src/Makefile</tt> for more details.
352
+ </p>
353
+ <pre class="code">
354
+ # Cross-compile to a 32 bit binary on a multilib x64 OS
355
+ make CC="gcc -m32"
356
+
357
+ # Cross-compile on Debian/Ubuntu for Windows (mingw32 package)
358
+ make HOST_CC="gcc -m32" CROSS=i586-mingw32msvc- TARGET_SYS=Windows
359
+ </pre>
360
+ <p id="cross2">
361
+ The <tt>CROSS</tt> prefix allows specifying a standard GNU cross-compile
362
+ toolchain (Binutils, GCC and a matching libc). The prefix may vary
363
+ depending on the <tt>--target</tt> the toolchain was built for (note the
364
+ <tt>CROSS</tt> prefix has a trailing <tt>"-"</tt>). The examples below
365
+ use the canonical toolchain triplets for Linux.
366
+ </p>
367
+ <p>
368
+ Since there's often no easy way to detect CPU features at runtime, it's
369
+ important to compile with the proper CPU or architecture settings. You
370
+ can specify these when building the toolchain yourself. Or add
371
+ <tt>-mcpu=...</tt> or <tt>-march=...</tt> to <tt>TARGET_CFLAGS</tt>. For
372
+ ARM it's important to have the correct <tt>-mfloat-abi=...</tt> setting,
373
+ too. Otherwise LuaJIT may not run at the full performance of your target
374
+ CPU.
375
+ </p>
376
+ <pre class="code">
377
+ # ARM soft-float
378
+ make HOST_CC="gcc -m32" CROSS=arm-linux-gnueabi- \
379
+ TARGET_CFLAGS="-mfloat-abi=soft"
380
+
381
+ # ARM soft-float ABI with VFP (example for Cortex-A8)
382
+ make HOST_CC="gcc -m32" CROSS=arm-linux-gnueabi- \
383
+ TARGET_CFLAGS="-mcpu=cortex-a8 -mfloat-abi=softfp"
384
+
385
+ # ARM hard-float ABI with VFP (armhf, requires recent toolchain)
386
+ make HOST_CC="gcc -m32" CROSS=arm-linux-gnueabihf-
387
+
388
+ # ARM64 (requires x64 host)
389
+ make CROSS=aarch64-linux-
390
+
391
+ # PPC
392
+ make HOST_CC="gcc -m32" CROSS=powerpc-linux-gnu-
393
+
394
+ # MIPS big-endian
395
+ make HOST_CC="gcc -m32" CROSS=mips-linux-
396
+ # MIPS little-endian
397
+ make HOST_CC="gcc -m32" CROSS=mipsel-linux-
398
+ </pre>
399
+ <p>
400
+ You can cross-compile for <b id="android">Android</b> using the <a href="http://developer.android.com/sdk/ndk/index.html"><span class="ext">&raquo;</span>&nbsp;Android NDK</a>.
401
+ The environment variables need to match the install locations and the
402
+ desired target platform. E.g. Android&nbsp;4.0 corresponds to ABI level&nbsp;14.
403
+ For details check the folder <tt>docs</tt> in the NDK directory.
404
+ </p>
405
+ <p>
406
+ Only a few common variations for the different CPUs, ABIs and platforms
407
+ are listed. Please use your own judgement for which combination you want
408
+ to build/deploy or which lowest common denominator you want to pick:
409
+ </p>
410
+ <pre class="code">
411
+ # Android/ARM, armeabi (ARMv5TE soft-float), Android 2.2+ (Froyo)
412
+ NDK=/opt/android/ndk
413
+ NDKABI=8
414
+ NDKVER=$NDK/toolchains/arm-linux-androideabi-4.6
415
+ NDKP=$NDKVER/prebuilt/linux-x86/bin/arm-linux-androideabi-
416
+ NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-arm"
417
+ make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF"
418
+
419
+ # Android/ARM, armeabi-v7a (ARMv7 VFP), Android 4.0+ (ICS)
420
+ NDK=/opt/android/ndk
421
+ NDKABI=14
422
+ NDKVER=$NDK/toolchains/arm-linux-androideabi-4.6
423
+ NDKP=$NDKVER/prebuilt/linux-x86/bin/arm-linux-androideabi-
424
+ NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-arm"
425
+ NDKARCH="-march=armv7-a -mfloat-abi=softfp -Wl,--fix-cortex-a8"
426
+ make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF $NDKARCH"
427
+
428
+ # Android/MIPS, mips (MIPS32R1 hard-float), Android 4.0+ (ICS)
429
+ NDK=/opt/android/ndk
430
+ NDKABI=14
431
+ NDKVER=$NDK/toolchains/mipsel-linux-android-4.6
432
+ NDKP=$NDKVER/prebuilt/linux-x86/bin/mipsel-linux-android-
433
+ NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-mips"
434
+ make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF"
435
+
436
+ # Android/x86, x86 (i686 SSE3), Android 4.0+ (ICS)
437
+ NDK=/opt/android/ndk
438
+ NDKABI=14
439
+ NDKVER=$NDK/toolchains/x86-4.6
440
+ NDKP=$NDKVER/prebuilt/linux-x86/bin/i686-linux-android-
441
+ NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-x86"
442
+ make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF"
443
+ </pre>
444
+ <p>
445
+ You can cross-compile for <b id="ios">iOS 3.0+</b> (iPhone/iPad) using the <a href="http://developer.apple.com/devcenter/ios/index.action"><span class="ext">&raquo;</span>&nbsp;iOS SDK</a>.
446
+ The environment variables need to match the iOS SDK version:
447
+ </p>
448
+ <p style="font-size: 8pt;">
449
+ Note: <b>the JIT compiler is disabled for iOS</b>, because regular iOS Apps
450
+ are not allowed to generate code at runtime. You'll only get the performance
451
+ of the LuaJIT interpreter on iOS. This is still faster than plain Lua, but
452
+ much slower than the JIT compiler. Please complain to Apple, not me.
453
+ Or use Android. :-p
454
+ </p>
455
+ <pre class="code">
456
+ IXCODE=`xcode-select -print-path`
457
+ ISDK=$IXCODE/Platforms/iPhoneOS.platform/Developer
458
+ ISDKVER=iPhoneOS6.0.sdk
459
+ ISDKP=$ISDK/usr/bin/
460
+ ISDKF="-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER"
461
+ make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" \
462
+ TARGET_SYS=iOS
463
+ </pre>
464
+
465
+ <h3 id="consoles">Cross-compiling for consoles</h3>
466
+ <p>
467
+ Building LuaJIT for consoles requires both a supported host compiler
468
+ (x86 or x64) and a cross-compiler (to PPC or ARM) from the official
469
+ console SDK.
470
+ </p>
471
+ <p>
472
+ Due to restrictions on consoles, the JIT compiler is disabled and only
473
+ the fast interpreter is built. This is still faster than plain Lua,
474
+ but much slower than the JIT compiler. The FFI is disabled, too, since
475
+ it's not very useful in such an environment.
476
+ </p>
477
+ <p>
478
+ The following commands build a static library <tt>libluajit.a</tt>,
479
+ which can be linked against your game, just like the Lua library.
480
+ </p>
481
+ <p>
482
+ To cross-compile for <b id="ps3">PS3</b> from a Linux host (requires
483
+ 32&nbsp;bit GCC, i.e. multilib Linux/x64) or a Windows host (requires
484
+ 32&nbsp;bit MinGW), run this command:
485
+ </p>
486
+ <pre class="code">
487
+ make HOST_CC="gcc -m32" CROSS=ppu-lv2-
488
+ </pre>
489
+ <p>
490
+ To cross-compile for <b id="ps4">PS4</b> from a Windows host,
491
+ open a "Visual Studio .NET Command Prompt" (64&nbsp;bit host compiler),
492
+ <tt>cd</tt> to the directory where you've unpacked the sources and
493
+ run the following commands:
494
+ </p>
495
+ <pre class="code">
496
+ cd src
497
+ ps4build
498
+ </pre>
499
+ <p>
500
+ To cross-compile for <b id="psvita">PS Vita</b> from a Windows host,
501
+ open a "Visual Studio .NET Command Prompt" (32&nbsp;bit host compiler),
502
+ <tt>cd</tt> to the directory where you've unpacked the sources and
503
+ run the following commands:
504
+ </p>
505
+ <pre class="code">
506
+ cd src
507
+ psvitabuild
508
+ </pre>
509
+ <p>
510
+ To cross-compile for <b id="xbox360">Xbox 360</b> from a Windows host,
511
+ open a "Visual Studio .NET Command Prompt" (32&nbsp;bit host compiler),
512
+ <tt>cd</tt> to the directory where you've unpacked the sources and run
513
+ the following commands:
514
+ </p>
515
+ <pre class="code">
516
+ cd src
517
+ xedkbuild
518
+ </pre>
519
+ <p>
520
+ To cross-compile for <b id="xboxone">Xbox One</b> from a Windows host,
521
+ open a "Visual Studio .NET Command Prompt" (64&nbsp;bit host compiler),
522
+ <tt>cd</tt> to the directory where you've unpacked the sources and run
523
+ the following commands:
524
+ </p>
525
+ <pre class="code">
526
+ cd src
527
+ xb1build
528
+ </pre>
529
+
530
+ <h2 id="embed">Embedding LuaJIT</h2>
531
+ <p>
532
+ LuaJIT is API-compatible with Lua 5.1. If you've already embedded Lua
533
+ into your application, you probably don't need to do anything to switch
534
+ to LuaJIT, except link with a different library:
535
+ </p>
536
+ <ul>
537
+ <li>It's strongly suggested to build LuaJIT separately using the supplied
538
+ build system. Please do <em>not</em> attempt to integrate the individual
539
+ source files into your build tree. You'll most likely get the internal build
540
+ dependencies wrong or mess up the compiler flags. Treat LuaJIT like any
541
+ other external library and link your application with either the dynamic
542
+ or static library, depending on your needs.</li>
543
+ <li>If you want to load C modules compiled for plain Lua
544
+ with <tt>require()</tt>, you need to make sure the public symbols
545
+ (e.g. <tt>lua_pushnumber</tt>) are exported, too:
546
+ <ul><li>On POSIX systems you can either link to the shared library
547
+ or link the static library into your application. In the latter case
548
+ you'll need to export all public symbols from your main executable
549
+ (e.g. <tt>-Wl,-E</tt> on Linux) and add the external dependencies
550
+ (e.g. <tt>-lm -ldl</tt> on Linux).</li>
551
+ <li>Since Windows symbols are bound to a specific DLL name, you need to
552
+ link to the <tt>lua51.dll</tt> created by the LuaJIT build (do not rename
553
+ the DLL). You may link LuaJIT statically on Windows only if you don't
554
+ intend to load Lua/C modules at runtime.
555
+ </li></ul>
556
+ </li>
557
+ <li>
558
+ If you're building a 64 bit application on OSX which links directly or
559
+ indirectly against LuaJIT, you need to link your main executable
560
+ with these flags:
561
+ <pre class="code">
562
+ -pagezero_size 10000 -image_base 100000000
563
+ </pre>
564
+ Also, it's recommended to <tt>rebase</tt> all (self-compiled) shared libraries
565
+ which are loaded at runtime on OSX/x64 (e.g. C extension modules for Lua).
566
+ See: <tt>man rebase</tt>
567
+ </li>
568
+ </ul>
569
+ <p>Additional hints for initializing LuaJIT using the C API functions:</p>
570
+ <ul>
571
+ <li>Here's a
572
+ <a href="http://lua-users.org/wiki/SimpleLuaApiExample"><span class="ext">&raquo;</span>&nbsp;simple example</a>
573
+ for embedding Lua or LuaJIT into your application.</li>
574
+ <li>Make sure you use <tt>luaL_newstate</tt>. Avoid using
575
+ <tt>lua_newstate</tt>, since this uses the (slower) default memory
576
+ allocator from your system (no support for this on x64).</li>
577
+ <li>Make sure you use <tt>luaL_openlibs</tt> and not the old Lua 5.0 style
578
+ of calling <tt>luaopen_base</tt> etc. directly.</li>
579
+ <li>To change or extend the list of standard libraries to load, copy
580
+ <tt>src/lib_init.c</tt> to your project and modify it accordingly.
581
+ Make sure the <tt>jit</tt> library is loaded or the JIT compiler
582
+ will not be activated.</li>
583
+ <li>The <tt>bit.*</tt> module for bitwise operations
584
+ is already built-in. There's no need to statically link
585
+ <a href="http://bitop.luajit.org/"><span class="ext">&raquo;</span>&nbsp;Lua BitOp</a> to your application.</li>
586
+ </ul>
587
+
588
+ <h2 id="distro">Hints for Distribution Maintainers</h2>
589
+ <p>
590
+ The LuaJIT build system has extra provisions for the needs of most
591
+ POSIX-based distributions. If you're a package maintainer for
592
+ a distribution, <em>please</em> make use of these features and
593
+ avoid patching, subverting, autotoolizing or messing up the build system
594
+ in unspeakable ways.
595
+ </p>
596
+ <p>
597
+ There should be absolutely no need to patch <tt>luaconf.h</tt> or any
598
+ of the Makefiles. And please do not hand-pick files for your packages &mdash;
599
+ simply use whatever <tt>make install</tt> creates. There's a reason
600
+ for all of the files <em>and</em> directories it creates.
601
+ </p>
602
+ <p>
603
+ The build system uses GNU make and auto-detects most settings based on
604
+ the host you're building it on. This should work fine for native builds,
605
+ even when sandboxed. You may need to pass some of the following flags to
606
+ <em>both</em> the <tt>make</tt> and the <tt>make install</tt> command lines
607
+ for a regular distribution build:
608
+ </p>
609
+ <ul>
610
+ <li><tt>PREFIX</tt> overrides the installation path and should usually
611
+ be set to <tt>/usr</tt>. Setting this also changes the module paths and
612
+ the paths needed to locate the shared library.</li>
613
+ <li><tt>DESTDIR</tt> is an absolute path which allows you to install
614
+ to a shadow tree instead of the root tree of the build system.</li>
615
+ <li><tt>MULTILIB</tt> sets the architecture-specific library path component
616
+ for multilib systems. The default is <tt>lib</tt>.</li>
617
+ <li>Have a look at the top-level <tt>Makefile</tt> and <tt>src/Makefile</tt>
618
+ for additional variables to tweak. The following variables <em>may</em> be
619
+ overridden, but it's <em>not</em> recommended, except for special needs
620
+ like cross-builds:
621
+ <tt>BUILDMODE, CC, HOST_CC, STATIC_CC, DYNAMIC_CC, CFLAGS, HOST_CFLAGS,
622
+ TARGET_CFLAGS, LDFLAGS, HOST_LDFLAGS, TARGET_LDFLAGS, TARGET_SHLDFLAGS,
623
+ TARGET_FLAGS, LIBS, HOST_LIBS, TARGET_LIBS, CROSS, HOST_SYS, TARGET_SYS
624
+ </tt></li>
625
+ </ul>
626
+ <p>
627
+ The build system has a special target for an amalgamated build, i.e.
628
+ <tt>make amalg</tt>. This compiles the LuaJIT core as one huge C file
629
+ and allows GCC to generate faster and shorter code. Alas, this requires
630
+ lots of memory during the build. This may be a problem for some users,
631
+ that's why it's not enabled by default. But it shouldn't be a problem for
632
+ most build farms. It's recommended that binary distributions use this
633
+ target for their LuaJIT builds.
634
+ </p>
635
+ <p>
636
+ The tl;dr version of the above:
637
+ </p>
638
+ <pre class="code">
639
+ make amalg PREFIX=/usr && \
640
+ make install PREFIX=/usr DESTDIR=/tmp/buildroot
641
+ </pre>
642
+ <p>
643
+ Finally, if you encounter any difficulties, please
644
+ <a href="contact.html">contact me</a> first, instead of releasing a broken
645
+ package onto unsuspecting users. Because they'll usually gonna complain
646
+ to me (the upstream) and not you (the package maintainer), anyway.
647
+ </p>
648
+ <br class="flush">
649
+ </div>
650
+ <div id="foot">
651
+ <hr class="hide">
652
+ Copyright &copy; 2005-2015 Mike Pall
653
+ <span class="noprint">
654
+ &middot;
655
+ <a href="contact.html">Contact</a>
656
+ </span>
657
+ </div>
658
+ </body>
659
+ </html>