{"id":7,"date":"2014-10-05T14:04:10","date_gmt":"2014-10-05T14:04:10","guid":{"rendered":"http:\/\/emacslisp.com\/?p=7"},"modified":"2016-01-21T06:40:15","modified_gmt":"2016-01-21T06:40:15","slug":"tcc-%e6%ba%90%e7%a0%81%e5%88%86%e6%9e%90%ef%bc%9a%e7%ac%ac%e4%b8%80%e6%ad%a5%e7%bc%96%e8%af%91","status":"publish","type":"post","link":"http:\/\/emacslisp.com\/?p=7","title":{"rendered":"Tcc \u6e90\u7801\u5206\u6790\uff1a\u7b2c\u4e00\u6b65\u7f16\u8bd1 (Tcc Source code analysis: First Step Compiling)"},"content":{"rendered":"<p>Tcc \u6e90\u7801\u5206\u6790\uff1a\u7b2c\u4e00\u6b65\u7f16\u8bd1<br \/>\nTcc Source code analysis: First Step Compiling<\/p>\n<p>Tiny C Compiler<\/p>\n<ol>\n<li><a href=\"http:\/\/bellard.org\/tcc\/\">http:\/\/bellard.org\/tcc\/<\/a> \u4e0b\u8f7d\u5730\u5740(download URL)<\/li>\n<li>\u89e3\u538b\u7f29 tcc (decompress tcc)<\/li>\n<li>\u50cf\u7f16\u8bd1\u5176\u4ed6\u5f00\u6e90\u8f6f\u4ef6\u90a3\u6837\u7f16\u8bd1\uff0ctcc \u89c4\u6a21\u8f83\u5c0f ( compiled as other open source, tcc is small size software)<\/li>\n<li>\u590d\u5236\u7f16\u8bd1\u597d\u7684libtcc1.a\u5230\/usr\/local\/lib\/tcc\/ (after compiling finished, copy libtcc1.a to \/usr\/local\/lib\/tcc)<br \/>\ncp libtcc1.a \/usr\/local\/lib\/tcc <\/li>\n<\/ol>\n<p>\u7f16\u8bd1\u76f4\u63a5.\/configure &amp;&amp; make    (compile use command .\/configure &#038;&#038; make)<\/p>\n<p>\u53ef\u4ee5\u914d\u7f6e-g\u6253\u5f00\u8c03\u8bd5\u914d\u7f6e,\u4ee5\u65b9\u4fbf\u540e\u7eed\u7528gdb\u8c03\u8bd5 (use -g to enable debug for gdb)<\/p>\n<p>.\/tcc 1.c -o 1 \u6765\u751f\u6210\u6267\u884c\u6587\u4ef6 (.\/tcc 1.c -o 1 to generate executable file)<\/p>\n<p>[code]<\/p>\n<p>#include &lt;stdlib.h&gt;<\/p>\n<p>int main(int argc,char **argv)<br \/>\n{<br \/>\nint x = 0;<br \/>\nprintf(&#8220;%d&#8221;,x);<br \/>\nreturn 0;<br \/>\n}<\/p>\n<p>[\/code]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tcc \u6e90\u7801\u5206\u6790\uff1a\u7b2c\u4e00\u6b65\u7f16\u8bd1 Tcc Source code analysis: First Step Compiling Tiny C Compiler http:\/\/bellard.org\/tcc\/ \u4e0b\u8f7d\u5730\u5740(download URL) \u89e3\u538b\u7f29 tcc (decompress tcc) \u50cf\u7f16\u8bd1\u5176\u4ed6\u5f00\u6e90\u8f6f\u4ef6\u90a3\u6837\u7f16\u8bd1\uff0ctcc \u89c4\u6a21\u8f83\u5c0f ( compiled as other open source, tcc is small size software) \u590d\u5236\u7f16\u8bd1\u597d\u7684libtcc1.a\u5230\/usr\/local\/lib\/tcc\/ (after compiling finished, copy libtcc1.a to \/usr\/local\/lib\/tcc) cp libtcc1.a \/usr\/local\/lib\/tcc \u7f16\u8bd1\u76f4\u63a5.\/configure &amp;&amp; make (compile use command .\/configure &#038;&#038; make) \u53ef\u4ee5\u914d\u7f6e-g\u6253\u5f00\u8c03\u8bd5\u914d\u7f6e,\u4ee5\u65b9\u4fbf\u540e\u7eed\u7528gdb\u8c03\u8bd5 (use -g [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-7","post","type-post","status-publish","format-standard","hentry","category-tcc-source-code-analysis"],"_links":{"self":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/7","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7"}],"version-history":[{"count":4,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":180,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/7\/revisions\/180"}],"wp:attachment":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}