tcc 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +35 -0
  3. data/README.md +196 -0
  4. data/ext/tcc/extconf.rb +25 -0
  5. data/ext/tcc/tcc-0.9.26.patch +30 -0
  6. data/ext/tcc/tcc-0.9.26/COPYING +504 -0
  7. data/ext/tcc/tcc-0.9.26/Changelog +396 -0
  8. data/ext/tcc/tcc-0.9.26/Makefile +349 -0
  9. data/ext/tcc/tcc-0.9.26/README +101 -0
  10. data/ext/tcc/tcc-0.9.26/TODO +93 -0
  11. data/ext/tcc/tcc-0.9.26/VERSION +1 -0
  12. data/ext/tcc/tcc-0.9.26/arm-gen.c +2005 -0
  13. data/ext/tcc/tcc-0.9.26/c67-gen.c +2560 -0
  14. data/ext/tcc/tcc-0.9.26/coff.h +446 -0
  15. data/ext/tcc/tcc-0.9.26/config.h +8 -0
  16. data/ext/tcc/tcc-0.9.26/config.mak +28 -0
  17. data/ext/tcc/tcc-0.9.26/config.texi +1 -0
  18. data/ext/tcc/tcc-0.9.26/configure +540 -0
  19. data/ext/tcc/tcc-0.9.26/conftest.c +71 -0
  20. data/ext/tcc/tcc-0.9.26/elf.h +1731 -0
  21. data/ext/tcc/tcc-0.9.26/examples/ex1.c +8 -0
  22. data/ext/tcc/tcc-0.9.26/examples/ex2.c +98 -0
  23. data/ext/tcc/tcc-0.9.26/examples/ex3.c +24 -0
  24. data/ext/tcc/tcc-0.9.26/examples/ex4.c +26 -0
  25. data/ext/tcc/tcc-0.9.26/examples/ex5.c +8 -0
  26. data/ext/tcc/tcc-0.9.26/i386-asm.c +1498 -0
  27. data/ext/tcc/tcc-0.9.26/i386-asm.h +473 -0
  28. data/ext/tcc/tcc-0.9.26/i386-gen.c +1096 -0
  29. data/ext/tcc/tcc-0.9.26/i386-tok.h +243 -0
  30. data/ext/tcc/tcc-0.9.26/il-gen.c +667 -0
  31. data/ext/tcc/tcc-0.9.26/il-opcodes.h +251 -0
  32. data/ext/tcc/tcc-0.9.26/include/float.h +57 -0
  33. data/ext/tcc/tcc-0.9.26/include/stdarg.h +41 -0
  34. data/ext/tcc/tcc-0.9.26/include/stdbool.h +10 -0
  35. data/ext/tcc/tcc-0.9.26/include/stddef.h +28 -0
  36. data/ext/tcc/tcc-0.9.26/include/tcclib.h +78 -0
  37. data/ext/tcc/tcc-0.9.26/include/varargs.h +12 -0
  38. data/ext/tcc/tcc-0.9.26/lib/Makefile +102 -0
  39. data/ext/tcc/tcc-0.9.26/lib/alloca86-bt.S +47 -0
  40. data/ext/tcc/tcc-0.9.26/lib/alloca86.S +35 -0
  41. data/ext/tcc/tcc-0.9.26/lib/alloca86_64.S +42 -0
  42. data/ext/tcc/tcc-0.9.26/lib/bcheck.c +875 -0
  43. data/ext/tcc/tcc-0.9.26/lib/libtcc1.c +691 -0
  44. data/ext/tcc/tcc-0.9.26/libtcc.c +1941 -0
  45. data/ext/tcc/tcc-0.9.26/libtcc.h +103 -0
  46. data/ext/tcc/tcc-0.9.26/stab.def +234 -0
  47. data/ext/tcc/tcc-0.9.26/stab.h +17 -0
  48. data/ext/tcc/tcc-0.9.26/tcc-doc.html +2332 -0
  49. data/ext/tcc/tcc-0.9.26/tcc-doc.info +1151 -0
  50. data/ext/tcc/tcc-0.9.26/tcc-doc.texi +1268 -0
  51. data/ext/tcc/tcc-0.9.26/tcc.1 +415 -0
  52. data/ext/tcc/tcc-0.9.26/tcc.c +352 -0
  53. data/ext/tcc/tcc-0.9.26/tcc.h +1379 -0
  54. data/ext/tcc/tcc-0.9.26/tccasm.c +1118 -0
  55. data/ext/tcc/tcc-0.9.26/tcccoff.c +948 -0
  56. data/ext/tcc/tcc-0.9.26/tccelf.c +3129 -0
  57. data/ext/tcc/tcc-0.9.26/tccgen.c +5841 -0
  58. data/ext/tcc/tcc-0.9.26/tccpe.c +1887 -0
  59. data/ext/tcc/tcc-0.9.26/tccpp.c +3128 -0
  60. data/ext/tcc/tcc-0.9.26/tccrun.c +737 -0
  61. data/ext/tcc/tcc-0.9.26/tcctok.h +278 -0
  62. data/ext/tcc/tcc-0.9.26/tests/Makefile +199 -0
  63. data/ext/tcc/tcc-0.9.26/tests/asmtest.S +609 -0
  64. data/ext/tcc/tcc-0.9.26/tests/boundtest.c +233 -0
  65. data/ext/tcc/tcc-0.9.26/tests/gcctestsuite.sh +33 -0
  66. data/ext/tcc/tcc-0.9.26/tests/libtcc_test.c +76 -0
  67. data/ext/tcc/tcc-0.9.26/tests/tcctest.c +2713 -0
  68. data/ext/tcc/tcc-0.9.26/tests/tests2/00_assignment.c +18 -0
  69. data/ext/tcc/tcc-0.9.26/tests/tests2/00_assignment.expect +3 -0
  70. data/ext/tcc/tcc-0.9.26/tests/tests2/01_comment.c +14 -0
  71. data/ext/tcc/tcc-0.9.26/tests/tests2/01_comment.expect +5 -0
  72. data/ext/tcc/tcc-0.9.26/tests/tests2/02_printf.c +18 -0
  73. data/ext/tcc/tcc-0.9.26/tests/tests2/02_printf.expect +15 -0
  74. data/ext/tcc/tcc-0.9.26/tests/tests2/03_struct.c +31 -0
  75. data/ext/tcc/tcc-0.9.26/tests/tests2/03_struct.expect +6 -0
  76. data/ext/tcc/tcc-0.9.26/tests/tests2/04_for.c +15 -0
  77. data/ext/tcc/tcc-0.9.26/tests/tests2/04_for.expect +10 -0
  78. data/ext/tcc/tcc-0.9.26/tests/tests2/05_array.c +21 -0
  79. data/ext/tcc/tcc-0.9.26/tests/tests2/05_array.expect +10 -0
  80. data/ext/tcc/tcc-0.9.26/tests/tests2/06_case.c +29 -0
  81. data/ext/tcc/tcc-0.9.26/tests/tests2/06_case.expect +8 -0
  82. data/ext/tcc/tcc-0.9.26/tests/tests2/07_function.c +30 -0
  83. data/ext/tcc/tcc-0.9.26/tests/tests2/07_function.expect +4 -0
  84. data/ext/tcc/tcc-0.9.26/tests/tests2/08_while.c +24 -0
  85. data/ext/tcc/tcc-0.9.26/tests/tests2/08_while.expect +11 -0
  86. data/ext/tcc/tcc-0.9.26/tests/tests2/09_do_while.c +24 -0
  87. data/ext/tcc/tcc-0.9.26/tests/tests2/09_do_while.expect +11 -0
  88. data/ext/tcc/tcc-0.9.26/tests/tests2/10_pointer.c +40 -0
  89. data/ext/tcc/tcc-0.9.26/tests/tests2/10_pointer.expect +8 -0
  90. data/ext/tcc/tcc-0.9.26/tests/tests2/11_precedence.c +40 -0
  91. data/ext/tcc/tcc-0.9.26/tests/tests2/11_precedence.expect +15 -0
  92. data/ext/tcc/tcc-0.9.26/tests/tests2/12_hashdefine.c +14 -0
  93. data/ext/tcc/tcc-0.9.26/tests/tests2/12_hashdefine.expect +2 -0
  94. data/ext/tcc/tcc-0.9.26/tests/tests2/13_integer_literals.c +20 -0
  95. data/ext/tcc/tcc-0.9.26/tests/tests2/13_integer_literals.expect +5 -0
  96. data/ext/tcc/tcc-0.9.26/tests/tests2/14_if.c +21 -0
  97. data/ext/tcc/tcc-0.9.26/tests/tests2/14_if.expect +2 -0
  98. data/ext/tcc/tcc-0.9.26/tests/tests2/15_recursion.c +21 -0
  99. data/ext/tcc/tcc-0.9.26/tests/tests2/15_recursion.expect +10 -0
  100. data/ext/tcc/tcc-0.9.26/tests/tests2/16_nesting.c +21 -0
  101. data/ext/tcc/tcc-0.9.26/tests/tests2/16_nesting.expect +18 -0
  102. data/ext/tcc/tcc-0.9.26/tests/tests2/17_enum.c +29 -0
  103. data/ext/tcc/tcc-0.9.26/tests/tests2/17_enum.expect +3 -0
  104. data/ext/tcc/tcc-0.9.26/tests/tests2/18_include.c +12 -0
  105. data/ext/tcc/tcc-0.9.26/tests/tests2/18_include.expect +3 -0
  106. data/ext/tcc/tcc-0.9.26/tests/tests2/18_include.h +1 -0
  107. data/ext/tcc/tcc-0.9.26/tests/tests2/19_pointer_arithmetic.c +28 -0
  108. data/ext/tcc/tcc-0.9.26/tests/tests2/19_pointer_arithmetic.expect +3 -0
  109. data/ext/tcc/tcc-0.9.26/tests/tests2/20_pointer_comparison.c +24 -0
  110. data/ext/tcc/tcc-0.9.26/tests/tests2/20_pointer_comparison.expect +6 -0
  111. data/ext/tcc/tcc-0.9.26/tests/tests2/21_char_array.c +33 -0
  112. data/ext/tcc/tcc-0.9.26/tests/tests2/21_char_array.expect +7 -0
  113. data/ext/tcc/tcc-0.9.26/tests/tests2/22_floating_point.c +50 -0
  114. data/ext/tcc/tcc-0.9.26/tests/tests2/22_floating_point.expect +16 -0
  115. data/ext/tcc/tcc-0.9.26/tests/tests2/23_type_coercion.c +54 -0
  116. data/ext/tcc/tcc-0.9.26/tests/tests2/23_type_coercion.expect +12 -0
  117. data/ext/tcc/tcc-0.9.26/tests/tests2/24_math_library.c +28 -0
  118. data/ext/tcc/tcc-0.9.26/tests/tests2/24_math_library.expect +18 -0
  119. data/ext/tcc/tcc-0.9.26/tests/tests2/25_quicksort.c +83 -0
  120. data/ext/tcc/tcc-0.9.26/tests/tests2/25_quicksort.expect +2 -0
  121. data/ext/tcc/tcc-0.9.26/tests/tests2/26_character_constants.c +17 -0
  122. data/ext/tcc/tcc-0.9.26/tests/tests2/26_character_constants.expect +8 -0
  123. data/ext/tcc/tcc-0.9.26/tests/tests2/27_sizeof.c +16 -0
  124. data/ext/tcc/tcc-0.9.26/tests/tests2/27_sizeof.expect +3 -0
  125. data/ext/tcc/tcc-0.9.26/tests/tests2/28_strings.c +46 -0
  126. data/ext/tcc/tcc-0.9.26/tests/tests2/28_strings.expect +19 -0
  127. data/ext/tcc/tcc-0.9.26/tests/tests2/29_array_address.c +13 -0
  128. data/ext/tcc/tcc-0.9.26/tests/tests2/29_array_address.expect +1 -0
  129. data/ext/tcc/tcc-0.9.26/tests/tests2/30_hanoi.c +122 -0
  130. data/ext/tcc/tcc-0.9.26/tests/tests2/30_hanoi.expect +71 -0
  131. data/ext/tcc/tcc-0.9.26/tests/tests2/31_args.c +14 -0
  132. data/ext/tcc/tcc-0.9.26/tests/tests2/31_args.expect +7 -0
  133. data/ext/tcc/tcc-0.9.26/tests/tests2/32_led.c +266 -0
  134. data/ext/tcc/tcc-0.9.26/tests/tests2/32_led.expect +4 -0
  135. data/ext/tcc/tcc-0.9.26/tests/tests2/33_ternary_op.c +15 -0
  136. data/ext/tcc/tcc-0.9.26/tests/tests2/33_ternary_op.expect +10 -0
  137. data/ext/tcc/tcc-0.9.26/tests/tests2/34_array_assignment.c +23 -0
  138. data/ext/tcc/tcc-0.9.26/tests/tests2/34_array_assignment.expect +2 -0
  139. data/ext/tcc/tcc-0.9.26/tests/tests2/35_sizeof.c +14 -0
  140. data/ext/tcc/tcc-0.9.26/tests/tests2/35_sizeof.expect +2 -0
  141. data/ext/tcc/tcc-0.9.26/tests/tests2/36_array_initialisers.c +21 -0
  142. data/ext/tcc/tcc-0.9.26/tests/tests2/36_array_initialisers.expect +20 -0
  143. data/ext/tcc/tcc-0.9.26/tests/tests2/37_sprintf.c +17 -0
  144. data/ext/tcc/tcc-0.9.26/tests/tests2/37_sprintf.expect +20 -0
  145. data/ext/tcc/tcc-0.9.26/tests/tests2/38_multiple_array_index.c +32 -0
  146. data/ext/tcc/tcc-0.9.26/tests/tests2/38_multiple_array_index.expect +4 -0
  147. data/ext/tcc/tcc-0.9.26/tests/tests2/39_typedef.c +31 -0
  148. data/ext/tcc/tcc-0.9.26/tests/tests2/39_typedef.expect +3 -0
  149. data/ext/tcc/tcc-0.9.26/tests/tests2/40_stdio.c +52 -0
  150. data/ext/tcc/tcc-0.9.26/tests/tests2/40_stdio.expect +27 -0
  151. data/ext/tcc/tcc-0.9.26/tests/tests2/41_hashif.c +85 -0
  152. data/ext/tcc/tcc-0.9.26/tests/tests2/41_hashif.expect +6 -0
  153. data/ext/tcc/tcc-0.9.26/tests/tests2/42_function_pointer.c +18 -0
  154. data/ext/tcc/tcc-0.9.26/tests/tests2/42_function_pointer.expect +2 -0
  155. data/ext/tcc/tcc-0.9.26/tests/tests2/43_void_param.c +15 -0
  156. data/ext/tcc/tcc-0.9.26/tests/tests2/43_void_param.expect +1 -0
  157. data/ext/tcc/tcc-0.9.26/tests/tests2/44_scoped_declarations.c +17 -0
  158. data/ext/tcc/tcc-0.9.26/tests/tests2/44_scoped_declarations.expect +1 -0
  159. data/ext/tcc/tcc-0.9.26/tests/tests2/45_empty_for.c +18 -0
  160. data/ext/tcc/tcc-0.9.26/tests/tests2/45_empty_for.expect +10 -0
  161. data/ext/tcc/tcc-0.9.26/tests/tests2/46_grep.c +564 -0
  162. data/ext/tcc/tcc-0.9.26/tests/tests2/47_switch_return.c +24 -0
  163. data/ext/tcc/tcc-0.9.26/tests/tests2/47_switch_return.expect +4 -0
  164. data/ext/tcc/tcc-0.9.26/tests/tests2/48_nested_break.c +26 -0
  165. data/ext/tcc/tcc-0.9.26/tests/tests2/48_nested_break.expect +1 -0
  166. data/ext/tcc/tcc-0.9.26/tests/tests2/49_bracket_evaluation.c +23 -0
  167. data/ext/tcc/tcc-0.9.26/tests/tests2/49_bracket_evaluation.expect +1 -0
  168. data/ext/tcc/tcc-0.9.26/tests/tests2/50_logical_second_arg.c +29 -0
  169. data/ext/tcc/tcc-0.9.26/tests/tests2/50_logical_second_arg.expect +20 -0
  170. data/ext/tcc/tcc-0.9.26/tests/tests2/51_static.c +30 -0
  171. data/ext/tcc/tcc-0.9.26/tests/tests2/51_static.expect +8 -0
  172. data/ext/tcc/tcc-0.9.26/tests/tests2/52_unnamed_enum.c +27 -0
  173. data/ext/tcc/tcc-0.9.26/tests/tests2/52_unnamed_enum.expect +9 -0
  174. data/ext/tcc/tcc-0.9.26/tests/tests2/54_goto.c +56 -0
  175. data/ext/tcc/tcc-0.9.26/tests/tests2/54_goto.expect +8 -0
  176. data/ext/tcc/tcc-0.9.26/tests/tests2/55_lshift_type.c +52 -0
  177. data/ext/tcc/tcc-0.9.26/tests/tests2/55_lshift_type.expect +1 -0
  178. data/ext/tcc/tcc-0.9.26/tests/tests2/LICENSE +37 -0
  179. data/ext/tcc/tcc-0.9.26/tests/tests2/Makefile +98 -0
  180. data/ext/tcc/tcc-0.9.26/texi2pod.pl +427 -0
  181. data/ext/tcc/tcc-0.9.26/win32/build-tcc.bat +60 -0
  182. data/ext/tcc/tcc-0.9.26/win32/examples/dll.c +12 -0
  183. data/ext/tcc/tcc-0.9.26/win32/examples/fib.c +23 -0
  184. data/ext/tcc/tcc-0.9.26/win32/examples/hello_dll.c +19 -0
  185. data/ext/tcc/tcc-0.9.26/win32/examples/hello_win.c +163 -0
  186. data/ext/tcc/tcc-0.9.26/win32/include/_mingw.h +139 -0
  187. data/ext/tcc/tcc-0.9.26/win32/include/assert.h +54 -0
  188. data/ext/tcc/tcc-0.9.26/win32/include/conio.h +409 -0
  189. data/ext/tcc/tcc-0.9.26/win32/include/ctype.h +281 -0
  190. data/ext/tcc/tcc-0.9.26/win32/include/dir.h +31 -0
  191. data/ext/tcc/tcc-0.9.26/win32/include/direct.h +68 -0
  192. data/ext/tcc/tcc-0.9.26/win32/include/dirent.h +135 -0
  193. data/ext/tcc/tcc-0.9.26/win32/include/dos.h +55 -0
  194. data/ext/tcc/tcc-0.9.26/win32/include/errno.h +75 -0
  195. data/ext/tcc/tcc-0.9.26/win32/include/excpt.h +123 -0
  196. data/ext/tcc/tcc-0.9.26/win32/include/fcntl.h +52 -0
  197. data/ext/tcc/tcc-0.9.26/win32/include/fenv.h +108 -0
  198. data/ext/tcc/tcc-0.9.26/win32/include/inttypes.h +297 -0
  199. data/ext/tcc/tcc-0.9.26/win32/include/io.h +418 -0
  200. data/ext/tcc/tcc-0.9.26/win32/include/limits.h +111 -0
  201. data/ext/tcc/tcc-0.9.26/win32/include/locale.h +91 -0
  202. data/ext/tcc/tcc-0.9.26/win32/include/malloc.h +175 -0
  203. data/ext/tcc/tcc-0.9.26/win32/include/math.h +777 -0
  204. data/ext/tcc/tcc-0.9.26/win32/include/mem.h +13 -0
  205. data/ext/tcc/tcc-0.9.26/win32/include/memory.h +40 -0
  206. data/ext/tcc/tcc-0.9.26/win32/include/process.h +176 -0
  207. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/conio_s.h +42 -0
  208. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/crtdbg_s.h +19 -0
  209. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/io_s.h +33 -0
  210. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/mbstring_s.h +52 -0
  211. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/search_s.h +25 -0
  212. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/stdio_s.h +145 -0
  213. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/stdlib_s.h +67 -0
  214. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/stralign_s.h +30 -0
  215. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/string_s.h +41 -0
  216. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/sys/timeb_s.h +34 -0
  217. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/tchar_s.h +266 -0
  218. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/time_s.h +61 -0
  219. data/ext/tcc/tcc-0.9.26/win32/include/sec_api/wchar_s.h +128 -0
  220. data/ext/tcc/tcc-0.9.26/win32/include/setjmp.h +160 -0
  221. data/ext/tcc/tcc-0.9.26/win32/include/share.h +28 -0
  222. data/ext/tcc/tcc-0.9.26/win32/include/signal.h +63 -0
  223. data/ext/tcc/tcc-0.9.26/win32/include/stdint.h +209 -0
  224. data/ext/tcc/tcc-0.9.26/win32/include/stdio.h +429 -0
  225. data/ext/tcc/tcc-0.9.26/win32/include/stdlib.h +580 -0
  226. data/ext/tcc/tcc-0.9.26/win32/include/string.h +164 -0
  227. data/ext/tcc/tcc-0.9.26/win32/include/sys/fcntl.h +13 -0
  228. data/ext/tcc/tcc-0.9.26/win32/include/sys/file.h +14 -0
  229. data/ext/tcc/tcc-0.9.26/win32/include/sys/locking.h +30 -0
  230. data/ext/tcc/tcc-0.9.26/win32/include/sys/stat.h +290 -0
  231. data/ext/tcc/tcc-0.9.26/win32/include/sys/time.h +69 -0
  232. data/ext/tcc/tcc-0.9.26/win32/include/sys/timeb.h +133 -0
  233. data/ext/tcc/tcc-0.9.26/win32/include/sys/types.h +118 -0
  234. data/ext/tcc/tcc-0.9.26/win32/include/sys/unistd.h +14 -0
  235. data/ext/tcc/tcc-0.9.26/win32/include/sys/utime.h +146 -0
  236. data/ext/tcc/tcc-0.9.26/win32/include/tchar.h +1102 -0
  237. data/ext/tcc/tcc-0.9.26/win32/include/time.h +287 -0
  238. data/ext/tcc/tcc-0.9.26/win32/include/vadefs.h +11 -0
  239. data/ext/tcc/tcc-0.9.26/win32/include/values.h +4 -0
  240. data/ext/tcc/tcc-0.9.26/win32/include/wchar.h +871 -0
  241. data/ext/tcc/tcc-0.9.26/win32/include/wctype.h +172 -0
  242. data/ext/tcc/tcc-0.9.26/win32/include/winapi/basetsd.h +149 -0
  243. data/ext/tcc/tcc-0.9.26/win32/include/winapi/basetyps.h +85 -0
  244. data/ext/tcc/tcc-0.9.26/win32/include/winapi/guiddef.h +151 -0
  245. data/ext/tcc/tcc-0.9.26/win32/include/winapi/intrin.h +11 -0
  246. data/ext/tcc/tcc-0.9.26/win32/include/winapi/poppack.h +8 -0
  247. data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack1.h +8 -0
  248. data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack2.h +8 -0
  249. data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack4.h +8 -0
  250. data/ext/tcc/tcc-0.9.26/win32/include/winapi/pshpack8.h +8 -0
  251. data/ext/tcc/tcc-0.9.26/win32/include/winapi/reason.h +80 -0
  252. data/ext/tcc/tcc-0.9.26/win32/include/winapi/specstrings.h +7 -0
  253. data/ext/tcc/tcc-0.9.26/win32/include/winapi/stralign.h +154 -0
  254. data/ext/tcc/tcc-0.9.26/win32/include/winapi/tvout.h +79 -0
  255. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winbase.h +2951 -0
  256. data/ext/tcc/tcc-0.9.26/win32/include/winapi/wincon.h +301 -0
  257. data/ext/tcc/tcc-0.9.26/win32/include/winapi/windef.h +293 -0
  258. data/ext/tcc/tcc-0.9.26/win32/include/winapi/windows.h +123 -0
  259. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winerror.h +3166 -0
  260. data/ext/tcc/tcc-0.9.26/win32/include/winapi/wingdi.h +4080 -0
  261. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winnetwk.h +476 -0
  262. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winnls.h +765 -0
  263. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winnt.h +5770 -0
  264. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winreg.h +272 -0
  265. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winuser.h +5651 -0
  266. data/ext/tcc/tcc-0.9.26/win32/include/winapi/winver.h +160 -0
  267. data/ext/tcc/tcc-0.9.26/win32/lib/chkstk.S +191 -0
  268. data/ext/tcc/tcc-0.9.26/win32/lib/crt1.c +34 -0
  269. data/ext/tcc/tcc-0.9.26/win32/lib/dllcrt1.c +13 -0
  270. data/ext/tcc/tcc-0.9.26/win32/lib/dllmain.c +9 -0
  271. data/ext/tcc/tcc-0.9.26/win32/lib/gdi32.def +337 -0
  272. data/ext/tcc/tcc-0.9.26/win32/lib/kernel32.def +765 -0
  273. data/ext/tcc/tcc-0.9.26/win32/lib/msvcrt.def +1399 -0
  274. data/ext/tcc/tcc-0.9.26/win32/lib/user32.def +654 -0
  275. data/ext/tcc/tcc-0.9.26/win32/lib/wincrt1.c +64 -0
  276. data/ext/tcc/tcc-0.9.26/win32/tcc-win32.txt +156 -0
  277. data/ext/tcc/tcc-0.9.26/win32/tools/tiny_impdef.c +243 -0
  278. data/ext/tcc/tcc-0.9.26/win32/tools/tiny_libmaker.c +258 -0
  279. data/ext/tcc/tcc-0.9.26/x86_64-asm.h +448 -0
  280. data/ext/tcc/tcc-0.9.26/x86_64-gen.c +1701 -0
  281. data/lib/tcc.rb +291 -0
  282. data/tcc.gemspec +15 -0
  283. metadata +343 -0
@@ -0,0 +1,415 @@
1
+ .\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
2
+ .\"
3
+ .\" Standard preamble:
4
+ .\" ========================================================================
5
+ .de Sp \" Vertical space (when we can't use .PP)
6
+ .if t .sp .5v
7
+ .if n .sp
8
+ ..
9
+ .de Vb \" Begin verbatim text
10
+ .ft CW
11
+ .nf
12
+ .ne \\$1
13
+ ..
14
+ .de Ve \" End verbatim text
15
+ .ft R
16
+ .fi
17
+ ..
18
+ .\" Set up some character translations and predefined strings. \*(-- will
19
+ .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20
+ .\" double quote, and \*(R" will give a right double quote. \*(C+ will
21
+ .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
22
+ .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
23
+ .\" nothing in troff, for use with C<>.
24
+ .tr \(*W-
25
+ .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26
+ .ie n \{\
27
+ . ds -- \(*W-
28
+ . ds PI pi
29
+ . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30
+ . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
31
+ . ds L" ""
32
+ . ds R" ""
33
+ . ds C` ""
34
+ . ds C' ""
35
+ 'br\}
36
+ .el\{\
37
+ . ds -- \|\(em\|
38
+ . ds PI \(*p
39
+ . ds L" ``
40
+ . ds R" ''
41
+ . ds C`
42
+ . ds C'
43
+ 'br\}
44
+ .\"
45
+ .\" Escape single quotes in literal strings from groff's Unicode transform.
46
+ .ie \n(.g .ds Aq \(aq
47
+ .el .ds Aq '
48
+ .\"
49
+ .\" If the F register is turned on, we'll generate index entries on stderr for
50
+ .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51
+ .\" entries marked with X<> in POD. Of course, you'll have to process the
52
+ .\" output yourself in some meaningful fashion.
53
+ .\"
54
+ .\" Avoid warning from groff about undefined register 'F'.
55
+ .de IX
56
+ ..
57
+ .nr rF 0
58
+ .if \n(.g .if rF .nr rF 1
59
+ .if (\n(rF:(\n(.g==0)) \{
60
+ . if \nF \{
61
+ . de IX
62
+ . tm Index:\\$1\t\\n%\t"\\$2"
63
+ ..
64
+ . if !\nF==2 \{
65
+ . nr % 0
66
+ . nr F 2
67
+ . \}
68
+ . \}
69
+ .\}
70
+ .rr rF
71
+ .\"
72
+ .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
73
+ .\" Fear. Run. Save yourself. No user-serviceable parts.
74
+ . \" fudge factors for nroff and troff
75
+ .if n \{\
76
+ . ds #H 0
77
+ . ds #V .8m
78
+ . ds #F .3m
79
+ . ds #[ \f1
80
+ . ds #] \fP
81
+ .\}
82
+ .if t \{\
83
+ . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
84
+ . ds #V .6m
85
+ . ds #F 0
86
+ . ds #[ \&
87
+ . ds #] \&
88
+ .\}
89
+ . \" simple accents for nroff and troff
90
+ .if n \{\
91
+ . ds ' \&
92
+ . ds ` \&
93
+ . ds ^ \&
94
+ . ds , \&
95
+ . ds ~ ~
96
+ . ds /
97
+ .\}
98
+ .if t \{\
99
+ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
100
+ . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
101
+ . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
102
+ . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
103
+ . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
104
+ . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
105
+ .\}
106
+ . \" troff and (daisy-wheel) nroff accents
107
+ .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
108
+ .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
109
+ .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
110
+ .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
111
+ .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
112
+ .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
113
+ .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
114
+ .ds ae a\h'-(\w'a'u*4/10)'e
115
+ .ds Ae A\h'-(\w'A'u*4/10)'E
116
+ . \" corrections for vroff
117
+ .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
118
+ .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
119
+ . \" for low resolution devices (crt and lpr)
120
+ .if \n(.H>23 .if \n(.V>19 \
121
+ \{\
122
+ . ds : e
123
+ . ds 8 ss
124
+ . ds o a
125
+ . ds d- d\h'-1'\(ga
126
+ . ds D- D\h'-1'\(hy
127
+ . ds th \o'bp'
128
+ . ds Th \o'LP'
129
+ . ds ae ae
130
+ . ds Ae AE
131
+ .\}
132
+ .rm #[ #] #H #V #F C
133
+ .\" ========================================================================
134
+ .\"
135
+ .IX Title "TCC 1"
136
+ .TH TCC 1 "2013-10-29" " " " "
137
+ .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138
+ .\" way too many mistakes in technical documents.
139
+ .if n .ad l
140
+ .nh
141
+ .SH "NAME"
142
+ tcc \- Tiny C Compiler
143
+ .SH "SYNOPSIS"
144
+ .IX Header "SYNOPSIS"
145
+ usage: tcc [options] [\fIinfile1\fR \fIinfile2\fR...] [\fB\-run\fR \fIinfile\fR \fIargs\fR...]
146
+ .SH "DESCRIPTION"
147
+ .IX Header "DESCRIPTION"
148
+ \&\s-1TCC\s0 options are a very much like gcc options. The main difference is that \s-1TCC\s0
149
+ can also execute directly the resulting program and give it runtime
150
+ arguments.
151
+ .PP
152
+ Here are some examples to understand the logic:
153
+ .ie n .IP """\f(CBtcc \-run a.c\f(CW""" 4
154
+ .el .IP "\f(CW\f(CBtcc \-run a.c\f(CW\fR" 4
155
+ .IX Item "tcc -run a.c"
156
+ Compile \fIa.c\fR and execute it directly
157
+ .ie n .IP """\f(CBtcc \-run a.c arg1\f(CW""" 4
158
+ .el .IP "\f(CW\f(CBtcc \-run a.c arg1\f(CW\fR" 4
159
+ .IX Item "tcc -run a.c arg1"
160
+ Compile a.c and execute it directly. arg1 is given as first argument to
161
+ the \f(CW\*(C`main()\*(C'\fR of a.c.
162
+ .ie n .IP """\f(CBtcc a.c \-run b.c arg1\f(CW""" 4
163
+ .el .IP "\f(CW\f(CBtcc a.c \-run b.c arg1\f(CW\fR" 4
164
+ .IX Item "tcc a.c -run b.c arg1"
165
+ Compile \fIa.c\fR and \fIb.c\fR, link them together and execute them. arg1 is given
166
+ as first argument to the \f(CW\*(C`main()\*(C'\fR of the resulting program.
167
+ .ie n .IP """\f(CBtcc \-o myprog a.c b.c\f(CW""" 4
168
+ .el .IP "\f(CW\f(CBtcc \-o myprog a.c b.c\f(CW\fR" 4
169
+ .IX Item "tcc -o myprog a.c b.c"
170
+ Compile \fIa.c\fR and \fIb.c\fR, link them and generate the executable \fImyprog\fR.
171
+ .ie n .IP """\f(CBtcc \-o myprog a.o b.o\f(CW""" 4
172
+ .el .IP "\f(CW\f(CBtcc \-o myprog a.o b.o\f(CW\fR" 4
173
+ .IX Item "tcc -o myprog a.o b.o"
174
+ link \fIa.o\fR and \fIb.o\fR together and generate the executable \fImyprog\fR.
175
+ .ie n .IP """\f(CBtcc \-c a.c\f(CW""" 4
176
+ .el .IP "\f(CW\f(CBtcc \-c a.c\f(CW\fR" 4
177
+ .IX Item "tcc -c a.c"
178
+ Compile \fIa.c\fR and generate object file \fIa.o\fR.
179
+ .ie n .IP """\f(CBtcc \-c asmfile.S\f(CW""" 4
180
+ .el .IP "\f(CW\f(CBtcc \-c asmfile.S\f(CW\fR" 4
181
+ .IX Item "tcc -c asmfile.S"
182
+ Preprocess with C preprocess and assemble \fIasmfile.S\fR and generate
183
+ object file \fIasmfile.o\fR.
184
+ .ie n .IP """\f(CBtcc \-c asmfile.s\f(CW""" 4
185
+ .el .IP "\f(CW\f(CBtcc \-c asmfile.s\f(CW\fR" 4
186
+ .IX Item "tcc -c asmfile.s"
187
+ Assemble (but not preprocess) \fIasmfile.s\fR and generate object file
188
+ \&\fIasmfile.o\fR.
189
+ .ie n .IP """\f(CBtcc \-r \-o ab.o a.c b.c\f(CW""" 4
190
+ .el .IP "\f(CW\f(CBtcc \-r \-o ab.o a.c b.c\f(CW\fR" 4
191
+ .IX Item "tcc -r -o ab.o a.c b.c"
192
+ Compile \fIa.c\fR and \fIb.c\fR, link them together and generate the object file \fIab.o\fR.
193
+ .PP
194
+ Scripting:
195
+ .PP
196
+ \&\s-1TCC\s0 can be invoked from \fIscripts\fR, just as shell scripts. You just
197
+ need to add \f(CW\*(C`#!/usr/local/bin/tcc \-run\*(C'\fR at the start of your C source:
198
+ .PP
199
+ .Vb 2
200
+ \& #!/usr/local/bin/tcc \-run
201
+ \& #include <stdio.h>
202
+ \&
203
+ \& int main()
204
+ \& {
205
+ \& printf("Hello World\en");
206
+ \& return 0;
207
+ \& }
208
+ .Ve
209
+ .PP
210
+ \&\s-1TCC\s0 can read C source code from \fIstandard input\fR when \fB\-\fR is used in
211
+ place of \fBinfile\fR. Example:
212
+ .PP
213
+ .Vb 1
214
+ \& echo \*(Aqmain(){puts("hello");}\*(Aq | tcc \-run \-
215
+ .Ve
216
+ .SH "OPTIONS"
217
+ .IX Header "OPTIONS"
218
+ .IP "\fB\-c\fR" 4
219
+ .IX Item "-c"
220
+ Generate an object file.
221
+ .IP "\fB\-o outfile\fR" 4
222
+ .IX Item "-o outfile"
223
+ Put object file, executable, or dll into output file \fIoutfile\fR.
224
+ .IP "\fB\-run source [args...]\fR" 4
225
+ .IX Item "-run source [args...]"
226
+ Compile file \fIsource\fR and run it with the command line arguments
227
+ \&\fIargs\fR. In order to be able to give more than one argument to a
228
+ script, several \s-1TCC\s0 options can be given \fIafter\fR the
229
+ \&\fB\-run\fR option, separated by spaces:
230
+ .Sp
231
+ .Vb 1
232
+ \& tcc "\-run \-L/usr/X11R6/lib \-lX11" ex4.c
233
+ .Ve
234
+ .Sp
235
+ In a script, it gives the following header:
236
+ .Sp
237
+ .Vb 1
238
+ \& #!/usr/local/bin/tcc \-run \-L/usr/X11R6/lib \-lX11
239
+ .Ve
240
+ .IP "\fB\-dumpversion\fR" 4
241
+ .IX Item "-dumpversion"
242
+ Print only the compiler version and nothing else.
243
+ .IP "\fB\-v\fR" 4
244
+ .IX Item "-v"
245
+ Display \s-1TCC\s0 version.
246
+ .IP "\fB\-vv\fR" 4
247
+ .IX Item "-vv"
248
+ Show included files. As sole argument, print search dirs (as below).
249
+ .IP "\fB\-bench\fR" 4
250
+ .IX Item "-bench"
251
+ Display compilation statistics.
252
+ .IP "\fB\-print\-search\-dirs\fR" 4
253
+ .IX Item "-print-search-dirs"
254
+ Print the configured installation directory and a list of library
255
+ and include directories tcc will search.
256
+ .PP
257
+ Preprocessor options:
258
+ .IP "\fB\-Idir\fR" 4
259
+ .IX Item "-Idir"
260
+ Specify an additional include path. Include paths are searched in the
261
+ order they are specified.
262
+ .Sp
263
+ System include paths are always searched after. The default system
264
+ include paths are: \fI/usr/local/include\fR, \fI/usr/include\fR
265
+ and \fIPREFIX/lib/tcc/include\fR. (\fI\s-1PREFIX\s0\fR is usually
266
+ \&\fI/usr\fR or \fI/usr/local\fR).
267
+ .IP "\fB\-Dsym[=val]\fR" 4
268
+ .IX Item "-Dsym[=val]"
269
+ Define preprocessor symbol \fBsym\fR to
270
+ val. If val is not present, its value is \fB1\fR. Function-like macros can
271
+ also be defined: \fB\-DF(a)=a+1\fR
272
+ .IP "\fB\-Usym\fR" 4
273
+ .IX Item "-Usym"
274
+ Undefine preprocessor symbol \fBsym\fR.
275
+ .PP
276
+ Compilation flags:
277
+ .PP
278
+ Note: each of the following warning options has a negative form beginning with
279
+ \&\fB\-fno\-\fR.
280
+ .IP "\fB\-funsigned\-char\fR" 4
281
+ .IX Item "-funsigned-char"
282
+ Let the \f(CW\*(C`char\*(C'\fR type be unsigned.
283
+ .IP "\fB\-fsigned\-char\fR" 4
284
+ .IX Item "-fsigned-char"
285
+ Let the \f(CW\*(C`char\*(C'\fR type be signed.
286
+ .IP "\fB\-fno\-common\fR" 4
287
+ .IX Item "-fno-common"
288
+ Do not generate common symbols for uninitialized data.
289
+ .IP "\fB\-fleading\-underscore\fR" 4
290
+ .IX Item "-fleading-underscore"
291
+ Add a leading underscore at the beginning of each C symbol.
292
+ .PP
293
+ Warning options:
294
+ .IP "\fB\-w\fR" 4
295
+ .IX Item "-w"
296
+ Disable all warnings.
297
+ .PP
298
+ Note: each of the following warning options has a negative form beginning with
299
+ \&\fB\-Wno\-\fR.
300
+ .IP "\fB\-Wimplicit\-function\-declaration\fR" 4
301
+ .IX Item "-Wimplicit-function-declaration"
302
+ Warn about implicit function declaration.
303
+ .IP "\fB\-Wunsupported\fR" 4
304
+ .IX Item "-Wunsupported"
305
+ Warn about unsupported \s-1GCC\s0 features that are ignored by \s-1TCC.\s0
306
+ .IP "\fB\-Wwrite\-strings\fR" 4
307
+ .IX Item "-Wwrite-strings"
308
+ Make string constants be of type \f(CW\*(C`const char *\*(C'\fR instead of \f(CW\*(C`char
309
+ *\*(C'\fR.
310
+ .IP "\fB\-Werror\fR" 4
311
+ .IX Item "-Werror"
312
+ Abort compilation if warnings are issued.
313
+ .IP "\fB\-Wall\fR" 4
314
+ .IX Item "-Wall"
315
+ Activate all warnings, except \fB\-Werror\fR, \fB\-Wunusupported\fR and
316
+ \&\fB\-Wwrite\-strings\fR.
317
+ .PP
318
+ Linker options:
319
+ .IP "\fB\-Ldir\fR" 4
320
+ .IX Item "-Ldir"
321
+ Specify an additional static library path for the \fB\-l\fR option. The
322
+ default library paths are \fI/usr/local/lib\fR, \fI/usr/lib\fR and \fI/lib\fR.
323
+ .IP "\fB\-lxxx\fR" 4
324
+ .IX Item "-lxxx"
325
+ Link your program with dynamic library libxxx.so or static library
326
+ libxxx.a. The library is searched in the paths specified by the
327
+ \&\fB\-L\fR option.
328
+ .IP "\fB\-Bdir\fR" 4
329
+ .IX Item "-Bdir"
330
+ Set the path where the tcc internal libraries (and include files) can be
331
+ found (default is \fIPREFIX/lib/tcc\fR).
332
+ .IP "\fB\-shared\fR" 4
333
+ .IX Item "-shared"
334
+ Generate a shared library instead of an executable.
335
+ .IP "\fB\-soname name\fR" 4
336
+ .IX Item "-soname name"
337
+ set name for shared library to be used at runtime
338
+ .IP "\fB\-static\fR" 4
339
+ .IX Item "-static"
340
+ Generate a statically linked executable (default is a shared linked
341
+ executable).
342
+ .IP "\fB\-rdynamic\fR" 4
343
+ .IX Item "-rdynamic"
344
+ Export global symbols to the dynamic linker. It is useful when a library
345
+ opened with \f(CW\*(C`dlopen()\*(C'\fR needs to access executable symbols.
346
+ .IP "\fB\-r\fR" 4
347
+ .IX Item "-r"
348
+ Generate an object file combining all input files.
349
+ .IP "\fB\-Wl,\-rpath=path\fR" 4
350
+ .IX Item "-Wl,-rpath=path"
351
+ Put custom seatch path for dynamic libraries into executable.
352
+ .IP "\fB\-Wl,\-\-oformat=fmt\fR" 4
353
+ .IX Item "-Wl,--oformat=fmt"
354
+ Use \fIfmt\fR as output format. The supported output formats are:
355
+ .RS 4
356
+ .ie n .IP """elf32\-i386""" 4
357
+ .el .IP "\f(CWelf32\-i386\fR" 4
358
+ .IX Item "elf32-i386"
359
+ \&\s-1ELF\s0 output format (default)
360
+ .ie n .IP """binary""" 4
361
+ .el .IP "\f(CWbinary\fR" 4
362
+ .IX Item "binary"
363
+ Binary image (only for executable output)
364
+ .ie n .IP """coff""" 4
365
+ .el .IP "\f(CWcoff\fR" 4
366
+ .IX Item "coff"
367
+ \&\s-1COFF\s0 output format (only for executable output for TMS320C67xx target)
368
+ .RE
369
+ .RS 4
370
+ .RE
371
+ .IP "\fB\-Wl,\-subsystem=console/gui/wince/...\fR" 4
372
+ .IX Item "-Wl,-subsystem=console/gui/wince/..."
373
+ Set type for \s-1PE \s0(Windows) executables.
374
+ .IP "\fB\-Wl,\-[Ttext=# | section\-alignment=# | file\-alignment=# | image\-base=# | stack=#]\fR" 4
375
+ .IX Item "-Wl,-[Ttext=# | section-alignment=# | file-alignment=# | image-base=# | stack=#]"
376
+ Modify executable layout.
377
+ .IP "\fB\-Wl,\-Bsymbolic\fR" 4
378
+ .IX Item "-Wl,-Bsymbolic"
379
+ Set \s-1DT_SYMBOLIC\s0 tag.
380
+ .PP
381
+ Debugger options:
382
+ .IP "\fB\-g\fR" 4
383
+ .IX Item "-g"
384
+ Generate run time debug information so that you get clear run time
385
+ error messages: \f(CW\*(C` test.c:68: in function \*(Aqtest5()\*(Aq: dereferencing
386
+ invalid pointer\*(C'\fR instead of the laconic \f(CW\*(C`Segmentation
387
+ fault\*(C'\fR.
388
+ .IP "\fB\-b\fR" 4
389
+ .IX Item "-b"
390
+ Generate additional support code to check
391
+ memory allocations and array/pointer bounds. \fB\-g\fR is implied. Note
392
+ that the generated code is slower and bigger in this case.
393
+ .Sp
394
+ Note: \fB\-b\fR is only available on i386 for the moment.
395
+ .IP "\fB\-bt N\fR" 4
396
+ .IX Item "-bt N"
397
+ Display N callers in stack traces. This is useful with \fB\-g\fR or
398
+ \&\fB\-b\fR.
399
+ .PP
400
+ Misc options:
401
+ .IP "\fB\-MD\fR" 4
402
+ .IX Item "-MD"
403
+ Generate makefile fragment with dependencies.
404
+ .IP "\fB\-MF depfile\fR" 4
405
+ .IX Item "-MF depfile"
406
+ Use \fIdepfile\fR as output for \-MD.
407
+ .PP
408
+ Note: \s-1GCC\s0 options \fB\-Ox\fR, \fB\-fx\fR and \fB\-mx\fR are
409
+ ignored.
410
+ .SH "SEE ALSO"
411
+ .IX Header "SEE ALSO"
412
+ \&\fIgcc\fR\|(1)
413
+ .SH "AUTHOR"
414
+ .IX Header "AUTHOR"
415
+ Fabrice Bellard
@@ -0,0 +1,352 @@
1
+ /*
2
+ * TCC - Tiny C Compiler
3
+ *
4
+ * Copyright (c) 2001-2004 Fabrice Bellard
5
+ *
6
+ * This library is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2 of the License, or (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public
17
+ * License along with this library; if not, write to the Free Software
18
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
+ */
20
+
21
+ #ifdef ONE_SOURCE
22
+ #include "libtcc.c"
23
+ #else
24
+ #include "tcc.h"
25
+ #endif
26
+
27
+ static void help(void)
28
+ {
29
+ printf("tcc version " TCC_VERSION " - Tiny C Compiler - Copyright (C) 2001-2006 Fabrice Bellard\n"
30
+ "Usage: tcc [options...] [-o outfile] [-c] infile(s)...\n"
31
+ " tcc [options...] -run infile [arguments...]\n"
32
+ "General options:\n"
33
+ " -c compile only - generate an object file\n"
34
+ " -o outfile set output filename\n"
35
+ " -run run compiled source\n"
36
+ " -fflag set or reset (with 'no-' prefix) 'flag' (see man page)\n"
37
+ " -Wwarning set or reset (with 'no-' prefix) 'warning' (see man page)\n"
38
+ " -w disable all warnings\n"
39
+ " -v show version\n"
40
+ " -vv show included files (as sole argument: show search paths)\n"
41
+ " -dumpversion\n"
42
+ " -bench show compilation statistics\n"
43
+ "Preprocessor options:\n"
44
+ " -E preprocess only\n"
45
+ " -Idir add include path 'dir'\n"
46
+ " -Dsym[=val] define 'sym' with value 'val'\n"
47
+ " -Usym undefine 'sym'\n"
48
+ "Linker options:\n"
49
+ " -Ldir add library path 'dir'\n"
50
+ " -llib link with dynamic or static library 'lib'\n"
51
+ " -pthread link with -lpthread and -D_REENTRANT (POSIX Linux)\n"
52
+ " -r generate (relocatable) object file\n"
53
+ " -rdynamic export all global symbols to dynamic linker\n"
54
+ " -shared generate a shared library\n"
55
+ " -soname set name for shared library to be used at runtime\n"
56
+ " -static static linking\n"
57
+ " -Wl,-opt[=val] set linker option (see manual)\n"
58
+ "Debugger options:\n"
59
+ " -g generate runtime debug info\n"
60
+ #ifdef CONFIG_TCC_BCHECK
61
+ " -b compile with built-in memory and bounds checker (implies -g)\n"
62
+ #endif
63
+ #ifdef CONFIG_TCC_BACKTRACE
64
+ " -bt N show N callers in stack traces\n"
65
+ #endif
66
+ "Misc options:\n"
67
+ " -nostdinc do not use standard system include paths\n"
68
+ " -nostdlib do not link with standard crt and libraries\n"
69
+ " -Bdir use 'dir' as tcc internal library and include path\n"
70
+ " -MD generate target dependencies for make\n"
71
+ " -MF depfile put generated dependencies here\n"
72
+ );
73
+ }
74
+
75
+ /* re-execute the i386/x86_64 cross-compilers with tcc -m32/-m64: */
76
+ #if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64
77
+ #ifdef _WIN32
78
+ #include <process.h>
79
+ static int execvp_win32(const char *prog, char **argv)
80
+ {
81
+ int ret = spawnvp(P_NOWAIT, prog, (char const*const*)argv);
82
+ if (-1 == ret)
83
+ return ret;
84
+ cwait(&ret, ret, WAIT_CHILD);
85
+ exit(ret);
86
+ }
87
+ #define execvp execvp_win32
88
+ #endif
89
+ static void exec_other_tcc(TCCState *s, char **argv, const char *optarg)
90
+ {
91
+ char child_path[4096], *child_name; const char *target;
92
+ switch (atoi(optarg)) {
93
+ #ifdef TCC_TARGET_I386
94
+ case 32: break;
95
+ case 64: target = "x86_64";
96
+ #else
97
+ case 64: break;
98
+ case 32: target = "i386";
99
+ #endif
100
+ pstrcpy(child_path, sizeof child_path - 40, argv[0]);
101
+ child_name = tcc_basename(child_path);
102
+ strcpy(child_name, target);
103
+ #ifdef TCC_TARGET_PE
104
+ strcat(child_name, "-win32");
105
+ #endif
106
+ strcat(child_name, "-tcc");
107
+ if (strcmp(argv[0], child_path)) {
108
+ if (s->verbose > 0)
109
+ printf("tcc: using '%s'\n", child_name), fflush(stdout);
110
+ execvp(argv[0] = child_path, argv);
111
+ }
112
+ tcc_error("'%s' not found", child_name);
113
+ case 0: /* ignore -march etc. */
114
+ break;
115
+ default:
116
+ tcc_warning("unsupported option \"-m%s\"", optarg);
117
+ }
118
+ }
119
+ #else
120
+ #define exec_other_tcc(s, argv, optarg)
121
+ #endif
122
+
123
+ static void gen_makedeps(TCCState *s, const char *target, const char *filename)
124
+ {
125
+ FILE *depout;
126
+ char buf[1024], *ext;
127
+ int i;
128
+
129
+ if (!filename) {
130
+ /* compute filename automatically
131
+ * dir/file.o -> dir/file.d */
132
+ pstrcpy(buf, sizeof(buf), target);
133
+ ext = tcc_fileextension(buf);
134
+ pstrcpy(ext, sizeof(buf) - (ext-buf), ".d");
135
+ filename = buf;
136
+ }
137
+
138
+ if (s->verbose)
139
+ printf("<- %s\n", filename);
140
+
141
+ /* XXX return err codes instead of error() ? */
142
+ depout = fopen(filename, "w");
143
+ if (!depout)
144
+ tcc_error("could not open '%s'", filename);
145
+
146
+ fprintf(depout, "%s : \\\n", target);
147
+ for (i=0; i<s->nb_target_deps; ++i)
148
+ fprintf(depout, " %s \\\n", s->target_deps[i]);
149
+ fprintf(depout, "\n");
150
+ fclose(depout);
151
+ }
152
+
153
+ static char *default_outputfile(TCCState *s, const char *first_file)
154
+ {
155
+ char buf[1024];
156
+ char *ext;
157
+ const char *name = "a";
158
+
159
+ if (first_file && strcmp(first_file, "-"))
160
+ name = tcc_basename(first_file);
161
+ pstrcpy(buf, sizeof(buf), name);
162
+ ext = tcc_fileextension(buf);
163
+ #ifdef TCC_TARGET_PE
164
+ if (s->output_type == TCC_OUTPUT_DLL)
165
+ strcpy(ext, ".dll");
166
+ else
167
+ if (s->output_type == TCC_OUTPUT_EXE)
168
+ strcpy(ext, ".exe");
169
+ else
170
+ #endif
171
+ if (( (s->output_type == TCC_OUTPUT_OBJ && !s->option_r) ||
172
+ (s->output_type == TCC_OUTPUT_PREPROCESS) )
173
+ && *ext)
174
+ strcpy(ext, ".o");
175
+ else
176
+ strcpy(buf, "a.out");
177
+
178
+ return tcc_strdup(buf);
179
+ }
180
+
181
+ static void print_paths(const char *msg, char **paths, int nb_paths)
182
+ {
183
+ int i;
184
+ printf("%s:\n%s", msg, nb_paths ? "" : " -\n");
185
+ for(i = 0; i < nb_paths; i++)
186
+ printf(" %s\n", paths[i]);
187
+ }
188
+
189
+ static void display_info(TCCState *s, int what)
190
+ {
191
+ switch (what) {
192
+ case 0:
193
+ printf("tcc version %s ("
194
+ #ifdef TCC_TARGET_I386
195
+ "i386"
196
+ # ifdef TCC_TARGET_PE
197
+ " Win32"
198
+ # endif
199
+ #elif defined TCC_TARGET_X86_64
200
+ "x86-64"
201
+ # ifdef TCC_TARGET_PE
202
+ " Win64"
203
+ # endif
204
+ #elif defined TCC_TARGET_ARM
205
+ "ARM"
206
+ # ifdef TCC_ARM_HARDFLOAT
207
+ " Hard Float"
208
+ # endif
209
+ # ifdef TCC_TARGET_PE
210
+ " WinCE"
211
+ # endif
212
+ #endif
213
+ #ifndef TCC_TARGET_PE
214
+ # ifdef __linux
215
+ " Linux"
216
+ # endif
217
+ #endif
218
+ ")\n", TCC_VERSION);
219
+ break;
220
+ case 1:
221
+ printf("install: %s/\n", s->tcc_lib_path);
222
+ /* print_paths("programs", NULL, 0); */
223
+ print_paths("crt", s->crt_paths, s->nb_crt_paths);
224
+ print_paths("libraries", s->library_paths, s->nb_library_paths);
225
+ print_paths("include", s->sysinclude_paths, s->nb_sysinclude_paths);
226
+ printf("elfinterp:\n %s\n", CONFIG_TCC_ELFINTERP);
227
+ break;
228
+ }
229
+ }
230
+
231
+ static int64_t getclock_us(void)
232
+ {
233
+ #ifdef _WIN32
234
+ struct _timeb tb;
235
+ _ftime(&tb);
236
+ return (tb.time * 1000LL + tb.millitm) * 1000LL;
237
+ #else
238
+ struct timeval tv;
239
+ gettimeofday(&tv, NULL);
240
+ return tv.tv_sec * 1000000LL + tv.tv_usec;
241
+ #endif
242
+ }
243
+
244
+ int main(int argc, char **argv)
245
+ {
246
+ TCCState *s;
247
+ int ret, optind, i, bench;
248
+ int64_t start_time = 0;
249
+ const char *first_file = NULL;
250
+
251
+ s = tcc_new();
252
+ s->output_type = TCC_OUTPUT_EXE;
253
+
254
+ optind = tcc_parse_args(s, argc - 1, argv + 1);
255
+
256
+ if (optind == 0) {
257
+ help();
258
+ return 1;
259
+ }
260
+
261
+ if (s->option_m)
262
+ exec_other_tcc(s, argv, s->option_m);
263
+
264
+ if (s->verbose)
265
+ display_info(s, 0);
266
+
267
+ if (s->print_search_dirs || (s->verbose == 2 && optind == 1)) {
268
+ tcc_set_output_type(s, TCC_OUTPUT_MEMORY);
269
+ display_info(s, 1);
270
+ return 0;
271
+ }
272
+
273
+ if (s->verbose && optind == 1)
274
+ return 0;
275
+
276
+ if (s->nb_files == 0)
277
+ tcc_error("no input files\n");
278
+
279
+ /* check -c consistency : only single file handled. XXX: checks file type */
280
+ if (s->output_type == TCC_OUTPUT_OBJ && !s->option_r) {
281
+ if (s->nb_libraries != 0)
282
+ tcc_error("cannot specify libraries with -c");
283
+ /* accepts only a single input file */
284
+ if (s->nb_files != 1)
285
+ tcc_error("cannot specify multiple files with -c");
286
+ }
287
+
288
+ if (s->output_type == TCC_OUTPUT_PREPROCESS) {
289
+ if (!s->outfile) {
290
+ s->ppfp = stdout;
291
+ } else {
292
+ s->ppfp = fopen(s->outfile, "w");
293
+ if (!s->ppfp)
294
+ tcc_error("could not write '%s'", s->outfile);
295
+ }
296
+ }
297
+
298
+ bench = s->do_bench;
299
+ if (bench)
300
+ start_time = getclock_us();
301
+
302
+ tcc_set_output_type(s, s->output_type);
303
+
304
+ /* compile or add each files or library */
305
+ for(i = ret = 0; i < s->nb_files && ret == 0; i++) {
306
+ const char *filename;
307
+
308
+ filename = s->files[i];
309
+ if (filename[0] == '-' && filename[1] == 'l') {
310
+ if (tcc_add_library(s, filename + 2) < 0) {
311
+ tcc_error_noabort("cannot find '%s'", filename);
312
+ ret = 1;
313
+ }
314
+ } else {
315
+ if (1 == s->verbose)
316
+ printf("-> %s\n", filename);
317
+ if (tcc_add_file(s, filename) < 0)
318
+ ret = 1;
319
+ if (!first_file)
320
+ first_file = filename;
321
+ }
322
+ }
323
+
324
+ if (0 == ret) {
325
+ if (bench)
326
+ tcc_print_stats(s, getclock_us() - start_time);
327
+
328
+ if (s->output_type == TCC_OUTPUT_MEMORY) {
329
+ #ifdef TCC_IS_NATIVE
330
+ ret = tcc_run(s, argc - 1 - optind, argv + 1 + optind);
331
+ #else
332
+ tcc_error_noabort("-run is not available in a cross compiler");
333
+ ret = 1;
334
+ #endif
335
+ } else if (s->output_type == TCC_OUTPUT_PREPROCESS) {
336
+ if (s->outfile)
337
+ fclose(s->ppfp);
338
+ } else {
339
+ if (!s->outfile)
340
+ s->outfile = default_outputfile(s, first_file);
341
+ ret = !!tcc_output_file(s, s->outfile);
342
+ /* dump collected dependencies */
343
+ if (s->gen_deps && !ret)
344
+ gen_makedeps(s, s->outfile, s->deps_outfile);
345
+ }
346
+ }
347
+
348
+ tcc_delete(s);
349
+ if (bench)
350
+ tcc_memstats();
351
+ return ret;
352
+ }