{"id":241812,"date":"2014-10-29T17:53:02","date_gmt":"2014-10-29T13:53:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=241812"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=241812","title":{"rendered":"<span class=\"post_title\">\u041d\u0435\u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c\u0430\u044f \u0438\u0433\u0440\u0430 \u0441\u043b\u043e\u0432 \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 CLANG, LLVM \u0438 msp430<\/span>"},"content":{"rendered":"<div class=\"content html_format\">       \u0426\u0435\u043b\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u044d\u043a-\u044d\u043d\u0434\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 LLVM MSP430<\/p>\n<h1>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h1>\n<p>  CLANG \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0444\u0440\u043e\u043d\u0442-\u044d\u043d\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0421 \u0434\u043b\u044f LLVM. LLVM \u2014 \u044d\u0442\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u0440\u043e\u043d\u0442-\u044d\u043d\u0434\u043e\u0432, \u0431\u044d\u043a-\u044d\u043d\u0434\u043e\u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c. \u042d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0443\u0442\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0444\u0440\u043e\u043d\u0442-\u044d\u043d\u0434\u043e\u0432 \u043a \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e (IR). \u0412\u0441\u0435 \u0431\u044d\u043a-\u044d\u043d\u0434\u044b \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u044e\u0442 \u0441 \u044d\u0442\u0438\u043c \u043e\u0431\u0449\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>  \u041e\u0434\u043d\u0430 \u0438\u0437 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u0435\u043d\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442, \u044d\u0442\u043e MSP430 \u2014 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043c\u0438\u043a\u0440\u043e\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445.<\/p>\n<p>  \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 MSP430 \u0432\u0435\u0441\u044c\u043c\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430. \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u043c\u043e\u0433\u0443 \u043f\u043e\u043c\u043e\u0447\u044c \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c, \u043a\u0442\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0444\u0435\u0439\u0441-\u043f\u0430\u043b\u043c\u0438\u0442, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043b\u0438\u0446\u043e. <sup>1<\/sup><\/p>\n<h1>\u041f\u043e\u0435\u0445\u0430\u043b\u0438<\/h1>\n<p>  \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044f \u0441\u043c\u043e\u0433\u0443 \u0432\u043e\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0431\u0435\u043b. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0430:<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<pre><code class=\"bash\">[Source Code (.cpp)] -&gt; [clang] --.ll --&gt; [llc] --.s --&gt; [msp430-gcc] --&gt; elf <\/code><\/pre>\n<p>  Clang \u0431\u0435\u0440\u0435\u0442 \u0432\u0430\u0448 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u043f\u043e\u0434 \u0441\u0432\u043e\u0435\u0439 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u043e\u0439. \u0412\u0441\u0435 \u044d\u0442\u043e \u043d\u0435 \u0447\u0442\u043e \u0438\u043d\u043e\u0435, \u043a\u0430\u043a \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043e\u0431\u044b\u0447\u043d\u043e \u0432\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0437\u0430\u0433\u043b\u044f\u043d\u0435\u0442\u0435 \u0432 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 IR, \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440 \u0438\u043b\u0438 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0443.<\/p>\n<p>  \u0427\u0442\u043e \u0443\u043f\u0443\u0449\u0435\u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 MSP430, \u0442\u0430\u043a \u044d\u0442\u043e \u0444\u0430\u043a\u0442, \u0447\u0442\u043e clang + llvm \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u0430\u0441 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a elf. \u041a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u042d\u0442\u043e \u0432\u0430\u0448\u0430 \u043b\u0438\u0447\u043d\u0430\u044f \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0443 \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0444\u0430\u0439\u043b\u0430 elf.<\/p>\n<p>  \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438, \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0432\u0435\u0441\u044c msp430-gcc. \u0412\u0430\u043c \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043d\u0443\u0436\u043d\u044b libc, \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043b\u0438\u043d\u043a\u0435\u0440\u0430 \u0438 binutils. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, msp430-gcc \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u0434\u0435\u043b\u043e, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0432\u0430\u043c \u043d\u0435 \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e elf (vector tables, crt0,&#8230;etc). \u0422\u0430\u043a \u0447\u0442\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0438\u043c.<\/p>\n<h1>\u0420\u0430\u0431\u043e\u0447\u0435\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435<\/h1>\n<p>  \u041c\u0430\u0448\u0438\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u2014 \u044d\u0442\u043e macbook pro \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c OSX 10.9.2. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f LLVM \u0438 msp430-gcc.<\/p>\n<p>  \u0414\u043e msp430-gcc \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043f\u0430\u0442\u0447\u0435\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e gcc, \u0432\u044b\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u043d\u0430 sourceforge.net. \u0412 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0431\u043e\u043b\u0435\u0435 \u0441\u0432\u0435\u0436\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u043e\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e Texas Instruments \u0438 RHEL \u0431\u0435\u0440\u0443\u0442 \u044d\u0442\u043e \u043d\u0430 \u0441\u0435\u0431\u044f.<\/p>\n<p>  \u0417\u0434\u043e\u0440\u043e\u0432\u043e, \u043f\u043e\u0434\u0443\u043c\u0430\u043b \u044f, TI \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 RHEL, \u0447\u0442\u043e\u0431\u044b \u0432\u0437\u044f\u0442\u044c \u043d\u0430 \u0441\u0435\u0431\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u043f\u0440\u0438\u0435\u0442\u0430\u0440\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u043f\u043e\u0434 windows.<\/p>\n<h1>FACEPALM 1<\/h1>\n<p>  TI \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043d\u0430 \u0441\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u0445 \u0438 \u0440\u0438\u0441\u043a (see TI&#8217;s compiler download). O\u043a\u0435-\u0435\u0439\u2026 \u0422\u0430\u043a \u043d\u0430 \u0447\u0442\u043e \u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c?<\/p>\n<h1>FACEPALM 2<\/h1>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e, \u044f \u043c\u043e\u0433\u0443 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0438 \u043d\u0435 \u0434\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0443, \u0447\u0442\u043e \u0438 \u044f \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u044e \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041f\u044b\u0442\u0430\u044f\u0441\u044c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u044d\u0442\u043e, \u044f \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e TI \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0443 \u043d\u0430 OS X. \u042d\u0442\u043e \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f xgcc \u0438 \u0442\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u0430, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u043b\u0430\u0433\u0438 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f OS X.<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0438\u0434\u0435\u0442, \u043d\u0443\u0436\u043d\u043e \u043b\u0438\u0448\u044c \u0443\u0431\u0440\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0430\u043a\u0438. \u042f \u043b\u0435\u043d\u0438\u0432, \u0438 \u0434\u043e\u043f\u0438\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430\u0432\u043e\u0434\u0438\u043b\u043e \u0442\u043e\u0441\u043a\u0443. \u0427\u0442\u043e \u0436, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u0440\u0430\u0437 \u0443\u0436 \u0441\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044e.<\/p>\n<h1>\u0427\u0442\u043e \u044f \u0441\u0434\u0435\u043b\u0430\u043b<\/h1>\n<p>  \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u043d\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0444\u0440\u043e\u043d\u0442-\u044d\u043d\u0434, \u043c\u043d\u0435 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043d\u0443\u0436\u0435\u043d \u043b\u0438\u043d\u043a\u0435\u0440\/\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440. \u042f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b, \u0447\u0442\u043e \u0435\u0441\u0442\u044c brew\/fink\/ports \u043f\u0443\u0442\u044c. \u042f \u0445\u043e\u0442\u0435\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 gcc4.7 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c brew, \u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0448\u0435\u043b.<\/p>\n<p>  \u0422\u0430\u043a \u0447\u0442\u043e \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043a (\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 sampsyo\/homebrew-mspgcc). \u041e\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 gcc, libc, gdb, mcu, binutils \u0438 mspdebug:  <\/p>\n<pre><code class=\"bash\">brew tap wbennett\/homebrew-mspgcc   brew install wbennett\/mspgcc\/msp430-binutils   brew install wbennett\/mspgcc\/msp430-gcc   brew install wbennett\/mspgcc\/msp430-libc   brew install wbennett\/mspgcc\/msp430-mcu   brew install wbennett\/mspgcc\/msp430-gdb   brew install mspdebug   <\/code><\/pre>\n<p>  \u0412\u0430\u0445\u2026 \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c gcc.<\/p>\n<h1>\u041c\u043e\u0435 \u043b\u0438\u0446\u043e \u0433\u043e\u0440\u0438\u0442<\/h1>\n<p>  \u0412\u0441\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0436\u0435\u0440\u0442\u0432\u043e\u0439 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0430\u0434\u0430, \u043d\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0435 \u0441\u0442\u0440\u0430\u0434\u0430\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 open source \u0441\u043e\u0444\u0442. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0445\u0438\u043d\u0442\u044b, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0442\u0440\u0435\u0434\u0430\u0445 \u043f\u043e\u043c\u043e\u0449\u0438 \u0438 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u0448\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c, \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u043f\u0435\u0440\u0438\u043e\u0434\u0443 \u043f\u043e\u043b\u0443\u0440\u0430\u0441\u043f\u0430\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0432 \u043d\u0438\u0445 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0449\u0435\u0442\u0435 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\u0445 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432 clang \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b msp430, \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u0442\u0435. \u0412\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u043d\u0430\u0434\u0435\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u043d\u0430\u0431\u043e\u0440\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043d\u0435\u043f\u043e\u0442\u0440\u0435\u0431\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043c\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0446\u0438\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b \u043d\u0435 \u0434\u0443\u043c\u0430\u043b\u0438:  <\/p>\n<pre><code>$&gt;clang -ccc-host-triple msp430-elf  clang-3.5: error: unsupported option '-ccc-host-triple'   clang-3.5: error: no such file or directory: 'msp430-elf'   clang-3.5: error: no input files <\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u044d\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<br \/>  \u042f \u043c\u043e\u0433\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0438\u0437-\u0437\u0430 \u0441\u0442\u0430\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 LLVM. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c llc \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a clang \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b \u0435\u0433\u043e \u0432 LLVM \u0431\u0430\u0439\u0442\u043a\u043e\u0434?.. \u0425\u043e\u0440\u043e\u0448\u043e, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0435\u0449\u0451 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c.<\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:  <\/p>\n<pre><code class=\"cpp\">#include &quot;msp430.h&quot; #include &quot;stdlib.h&quot;  int main(void)   {     \/\/disable watchdog     WDCTL = WDTPW + WDTHOLD;      \/\/do something silly     auto i = 1;     auto result = i+1;      \/\/avoid warnings     if(result == 2)         return 2;      \/\/loop forever     while(true){}      \/\/never reach this     return 0; } <\/code><\/pre>\n<pre><code>#compile application to llvm assembler ~\/local\/bin\/clang++ -I\/usr\/local\/Cellar\/msp430-libc\/20120716\/msp430\/include\/       -D__MSP430F5438__ -g -S -emit-llvm -std=c++11 -Wall -c src\/simpleadd.cpp -o src\/simpleadd.ll<\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442, \u043a\u0430\u043a \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 LL  <\/p>\n<pre><code class=\"bash\">; ModuleID = 'src\/simpleadd.cpp' target datalayout = &quot;e-m:o-i64:64-f80:128-n8:16:32:64-S128&quot;   target triple = &quot;x86_64-apple-macosx10.9.0&quot;  @&quot;\\01__WDTCTL&quot; = external global i32  ; Function Attrs: nounwind ssp uwtable define i32 @main() #0 {     %1 = alloca i32, align 4   %i = alloca i32, align 4   %result = alloca i32, align 4   store i32 0, i32* %1   store volatile i32 23168, i32* @&quot;\\01__WDTCTL&quot;, align 4   store i32 1, i32* %i, align 4   %2 = load i32* %i, align 4   %3 = add nsw i32 %2, 1   store i32 %3, i32* %result, align 4   %4 = load i32* %result, align 4   %5 = icmp eq i32 %4, 2   br i1 %5, label %6, label %7  ; &lt;label&gt;:6                                       ; preds = %0   ret i32 2  ; &lt;label&gt;:7                                       ; preds = %0   br label %8  ; &lt;label&gt;:8                                       ; preds = %7, %8   br label %8 }  attributes #0 = { nounwind ssp uwtable &quot;less-precise-fpmad&quot;=&quot;false&quot; &quot;no-frame-pointer-elim&quot;=&quot;true&quot; &quot;no-frame-pointer-elim-non-leaf&quot; &quot;no-infs-fp-math&quot;=&quot;false&quot; &quot;no-nans-fp-math&quot;=&quot;false&quot; &quot;stack-protector-buffer-size&quot;=&quot;8&quot; &quot;unsafe-fp-math&quot;=&quot;false&quot; &quot;use-soft-float&quot;=&quot;false&quot; }  !llvm.ident = !{!0}  !0 = metadata !{metadata !&quot;clang version 3.5 &quot;} <\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043c \u044d\u0442\u043e \u0432 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440 \u0434\u043b\u044f msp430, \u0447\u0442\u043e llc \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c?  <\/p>\n<pre><code>$&gt;~\/local\/bin\/llc --help ... -mcpu=&lt;cpu-name&gt;                 - Target a specific cpu type (-mcpu=help for details) #ok more specific plz $&gt;~\/local\/bin\/llc -mcpu=help ...   amdfam10      - Select the amdfam10 processor.   athlon        - Select the athlon processor.   athlon-4      - Select the athlon-4 processor.   athlon-fx     - Select the athlon-fx processor.   athlon-mp     - Select the athlon-mp processor.   athlon-tbird  - Select the athlon-tbird processor.   athlon-xp     - Select the athlon-xp processor.   athlon64      - Select the athlon64 processor.   athlon64-sse3 - Select the athlon64-sse3 processor. ... <\/code><\/pre>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c msp430? \u042f \u043a\u043b\u044f\u043d\u0443\u0441\u044c, \u0447\u0442\u043e \u0433\u0434\u0435-\u0442\u043e \u0447\u0438\u0442\u0430\u043b, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f msp430.<\/p>\n<p>  \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u043e\u043c\u043e\u0449\u044c\u044e.  <\/p>\n<pre><code>$&gt;~\/local\/bin\/llc --help ... -march=&lt;string&gt;                  - Architecture to generate code for (see --version) #ok $&gt;~\/local\/bin\/llc --version LLVM (http:\/\/llvm.org\/):     LLVM version 3.5svn   DEBUG build.   Built Mar  1 2014 (22:49:35).   Default target: x86_64-apple-darwin13.1.0   Host CPU: core-avx-i    Registered Targets:     aarch64    - AArch64 (ARM 64-bit little endian target)     aarch64_be - AArch64 (ARM 64-bit big endian target)     arm        - ARM     cpp        - C++ backend     hexagon    - Hexagon     mips       - Mips     mips64     - Mips64 [experimental]     mips64el   - Mips64el [experimental]     mipsel     - Mipsel     msp430     - MSP430 [experimental]     nvptx      - NVIDIA PTX 32-bit     nvptx64    - NVIDIA PTX 64-bit     ppc32      - PowerPC 32     ppc64      - PowerPC 64     ppc64le    - PowerPC 64 LE     r600       - AMD GPUs HD2XXX-HD6XXX     sparc      - Sparc     sparcv9    - Sparc V9     systemz    - SystemZ     thumb      - Thumb     x86        - 32-bit X86: Pentium-Pro and above     x86-64     - 64-bit X86: EM64T and AMD64     xcore      - XCore <\/code><\/pre>\n<p>  \u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u043e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c msp430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440!  <\/p>\n<pre><code>~\/local\/bin\/llc -march=msp430  src\/simpleadd.ll -o src\/simpleadd.s <\/code><\/pre>\n<p>  \u041d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d, \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b main \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 text, \u043d\u0443 \u0434\u0430 \u0431\u043e\u0433 \u0441 \u043d\u0438\u043c. <sup>2<\/sup>  <\/p>\n<pre><code>    .file   &quot;src\/simpleadd.ll&quot;     .text     .globl  main     .align  2     .type   main,@function main:                                   ; @main   ; BB#0:     push.w  r4     mov.w   r1, r4     sub.w   #12, r1     mov.w   #0, -2(r4)     mov.w   #0, -4(r4)     mov.w   #0, &__WDTCTL+2     mov.w   #23168, &__WDTCTL     mov.w   #0, -6(r4)     mov.w   #1, -8(r4)     mov.w   #0, -10(r4)     mov.w   #2, -12(r4)     mov.w   #0, r12     cmp.w   #0, r12     jne .LBB0_2 ; BB#1:     mov.w   #2, r14     mov.w   #0, r15     add.w   #12, r1     pop.w   r4     ret .LBB0_2:                                ; =&gt;This Inner Loop Header: Depth=1     jmp .LBB0_2 .Ltmp0:     .size   main, .Ltmp0-main       .ident  &quot;clang version 3.5 &quot; <\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0433\u0435\u043d\u0435\u043d\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a.  <\/p>\n<pre><code>$&gt;msp430-gcc -Wall -D_GNU_ASSEMBLER_ -I\/usr\/local\/Cellar\/msp430-libc\/20120716\/msp430\/include\/       -mmcu=msp430f5438 -mcpu=430 -x assembler -Wa,-gstabs -c src\/simpleadd.s -o src\/simpleadd.o #let's hint our entry point (-e main), because it's weird to be placing main in the text section #let's also generate a map to see how everything is linked $&gt;msp430-gcc  -mmcu=msp430f5438 -mcpu=430 -Wl,-Map=a.out.map src\/simpleadd.o  -o a.out -e main <\/code><\/pre>\n<p>  \u0411\u0435\u0437 \u043f\u0430\u043d\u0438\u043a\u0438, \u043f\u043e\u0445\u043e\u0436\u0435, \u043c\u044b \u043d\u0430 \u0432\u0435\u0440\u043d\u043e\u043c \u043f\u0443\u0442\u0438.<br \/>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, facepalm 3. \u041c\u043e\u0435 \u043b\u0438\u0446\u043e \u043a\u0440\u0430\u0441\u043d\u043e\u0435 \u0438 \u0432 \u0441\u0438\u043d\u044f\u043a\u0430\u0445. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 map \u0444\u0430\u0439\u043b\u0430 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043b\u0438\u043d\u043a\u0435\u0440 \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0435\u0447\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0435:  <\/p>\n<pre><code>*(.init .init.*)  791  *(.init0)  792  .init0         0x0000000000005c00        0x0 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(_re#  793                 0x0000000000005c00                _reset_vector__  794  *(.init1)  795  .init1         0x0000000000005c00        0xc \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(__w#  796                 0x0000000000005c00                __watchdog_support  797  *(.init2)  798  .init2         0x0000000000005c0c        0x4 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(__i#  799                 0x0000000000005c0c                __init_stack  800  *(.init3)                                                                                                                    801  .init3         0x0000000000005c10        0x0 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(__l#  802                 0x0000000000005c10                __low_level_init  803  *(.init4)  804  .init4         0x0000000000005c10       0x18 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(_co#  805                 0x0000000000005c10                __do_copy_data  806  .init4         0x0000000000005c28       0x16 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(_cl#  807                 0x0000000000005c28                __do_clear_bss  808  *(.init5)  809  *(.init6)  810  *(.init7)  811  *(.init8)  812  *(.init9)  813  *(.fini9)  814  .fini9         0x0000000000005c3e        0x0 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(__s#  815                 0x0000000000005c3e                __stop_progExec__  816  *(.fini8)  817  *(.fini7)  818  *(.fini6)  819  *(.fini5)  820  *(.fini4)  821  *(.fini3)  822  *(.fini2)  823  *(.fini1)  824  *(.fini0)  825  .fini0         0x0000000000005c3e        0x6 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(_en#  826                 0x0000000000005c3e                _endless_loop__ ....  869  .text.crt0     0x0000000000005c48        0x0 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/crt0ivtbl64.o  870  .text          0x0000000000005c48       0x40 src\/simpleadd.o  871                 0x0000000000005c48                main <\/code><\/pre>\n<p>  \u041b\u0438\u043d\u043a\u0435\u0440 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u0437\u0430\u043f\u0438\u0441\u044c \u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043d\u0430 main \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 .init9. \u041b\u0430\u0434\u043d\u043e, \u0434\u0430\u043c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u0438\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e clang \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u043a\u0430\u043a \u043b\u0438\u043d\u043a\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0438\u043b\u0438 \u0435\u043c\u0443 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e:  <\/p>\n<pre><code class=\"bash\">...     .file   &quot;src\/simpleadd.ll&quot;     .text     .globl  main     .align  2     .type   main,@function main:                                   ; @main   ... <\/code><\/pre>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e Mr.Clang, \u0434\u0443\u043c\u0430\u044e, \u044f \u043c\u043e\u0433\u0443 \u0432\u0430\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043c\u043e\u0447\u044c. \u0427\u0442\u043e\u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0433\u0434\u0435 \u044f \u0445\u043e\u0447\u0443, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0434, \u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:  <\/p>\n<pre><code>__attribute__((section(&quot;.init9&quot;)),aligned(2)).   <\/code><\/pre>\n<p>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Crt0 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0441\u0442\u0430\u0440\u0442\u0430\u043f\u0430, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043e\u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0432\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 main. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u00ab\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f\u00bb, \u043e\u043d \u0432\u043e\u0439\u0434\u0435\u0442 \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u043f\u043e\u0441\u043b\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0438\u0437 main.<\/p>\n<p>  \u0428\u0430\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 (\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441 Crt0), \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:  <\/p>\n<ol>\n<li> \u0412\u0435\u043a\u0442\u043e\u0440 \u0441\u0431\u0440\u043e\u0441\u0430<\/li>\n<li> \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432\u043e\u0447\u0434\u043e\u0433\u0430<\/li>\n<li> \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0435\u043a\u0430<\/li>\n<li> \u041d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0430\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/li>\n<li> \u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li> \u041e\u0447\u0438\u0441\u0442\u043a\u0430 \u041e\u0417\u0423<\/li>\n<li> \u0412\u044b\u0437\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432\/\u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432<\/li>\n<li> \u0412\u044b\u0437\u043e\u0432 main<\/li>\n<li> \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0438\u0437 main<\/li>\n<\/ol>\n<p>  \u041d\u043e\u0432\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cpp\">__attribute__((section(&quot;.init9&quot;),aligned(2)))   int main(void)   { ... <\/code><\/pre>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c:<\/p>\n<pre><code>$&gt;~\/local\/bin\/clang++ -I\/usr\/local\/Cellar\/msp430-libc\/20120716\/msp430\/include\/      -D__MSP430F5438__ -S -emit-llvm -std=c++11 -Wall -c src\/simpleadd.cpp -o src\/simpleadd.ll ... rc\/simpleadd.cpp:4:24: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a         segment and section separated by a comma __attribute__((section(&quot;.init9&quot;),aligned(2)))  <\/code><\/pre>\n<p>  Facepalm 4, Mr. Clang \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043c\u0435\u043d\u044f \u0438\u0437 \u0441\u0435\u0431\u044f.<br \/>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a &#8212;help. \u042f \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438, \u0433\u0434\u0435 \u044f, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0447\u0442\u043e-\u0442\u043e \u0443\u043f\u0443\u0441\u0442\u0438\u043b.<\/p>\n<p>  \u0412 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432, \u043d\u0430\u0448\u0435\u043b.  <\/p>\n<pre><code>$&gt;~\/local\/bin\/clang++ --help ... --target=&lt;value&gt;        Generate code for the given target ... <\/code><\/pre>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u0435\u043d, \u043c\u043e\u0439 \u043a\u043e\u0441\u044f\u043a. \u041f\u0440\u043e\u0448\u0443 \u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f. \u041d\u0443 \u0438 \u043a\u0430\u043a \u043c\u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0446\u0435\u043b\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f?<br \/>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e \u043e\u0431\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432:  <\/p>\n<pre><code>~\/local\/bin\/clang++ --target=help clang-3.5: error: no input files   #version maybe? ~\/local\/bin\/clang++ --version clang version 3.5   Target: x86_64-apple-darwin13.1.0   Thread model: posix   <\/code><\/pre>\n<p>  \u041d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u2026 \u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435:  <\/p>\n<pre><code>~\/local\/bin\/clang++ -I\/usr\/local\/Cellar\/msp430-libc\/20120716\/msp430\/include\/ \\     -D__MSP430F5438__ -S -emit-llvm -std=c++11 --target=msp430 \\     -Wall -c src\/simpleadd.cpp -o src\/simpleadd.ll <\/code><\/pre>\n<p>  \u0411\u0430\u0431\u0430\u0445!<\/p>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043e\u0442 \u043d\u0435\u0433\u043e \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0438 \u044f \u043c\u043e\u0433\u0443 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435.<br \/>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 .ll:  <\/p>\n<pre><code>; ModuleID = 'src\/simpleadd.cpp' target datalayout = &quot;e-m:e-p:16:16-i32:16:32-n8:16&quot;   target triple = &quot;msp430&quot;  @&quot;\\01__WDTCTL&quot; = external global i16  ; Function Attrs: nounwind define i16 @main() #0 section &quot;.init9&quot; align 2 {     %1 = alloca i16, align 2   %i = alloca i16, align 2   %result = alloca i16, align 2   store i16 0, i16* %1   store volatile i16 23168, i16* @&quot;\\01__WDTCTL&quot;, align 2   store i16 1, i16* %i, align 2   %2 = load i16* %i, align 2   %3 = add nsw i16 %2, 1   store i16 %3, i16* %result, align 2   %4 = load i16* %result, align 2   %5 = icmp eq i16 %4, 2   br i1 %5, label %6, label %7  ; &lt;label&gt;:6                                       ; preds = %0   ret i16 2  ; &lt;label&gt;:7                                       ; preds = %0   br label %8  ; &lt;label&gt;:8                                       ; preds = %7, %8   br label %8 }  attributes #0 = { nounwind &quot;less-precise-fpmad&quot;=&quot;false&quot; &quot;no-frame-pointer-elim&quot;=&quot;true&quot; &quot;no-frame-pointer-elim-non-leaf&quot; &quot;no-infs-fp-math&quot;=&quot;false&quot; &quot;no-nans-fp-math&quot;=&quot;false&quot; &quot;stack-protector-buffer-size&quot;=&quot;8&quot; &quot;unsafe-fp-math&quot;=&quot;false&quot; &quot;use-soft-float&quot;=&quot;false&quot; }  !llvm.ident = !{!0}  !0 = metadata !{metadata !&quot;clang version 3.5 &quot;} <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 .s:  <\/p>\n<pre><code>    .file   &quot;src\/simpleadd.ll&quot;     .section    .init9,&quot;ax&quot;,@progbits     .globl  main     .align  1     .type   main,@function main:                                   ; @main   ; BB#0:     push.w  r4     mov.w   r1, r4     sub.w   #6, r1     mov.w   #0, -2(r4)     mov.w   #23168, &__WDTCTL     mov.w   #1, -4(r4)     mov.w   #2, -6(r4)     mov.w   #2, r12     cmp.w   #2, r12     jne .LBB0_2 ; BB#1:     mov.w   #2, r15     add.w   #6, r1     pop.w   r4     ret .LBB0_2:                                ; =&gt;This Inner Loop Header: Depth=1     jmp .LBB0_2 .Ltmp0:     .size   main, .Ltmp0-main       .ident  &quot;clang version 3.5 &quot; <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e main \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u043c .map:  <\/p>\n<pre><code> 792  .init0         0x0000000000005c00        0x0 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(_re#  793                 0x0000000000005c00                _reset_vector__  794  *(.init1)  795  .init1         0x0000000000005c00        0xc \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(__w#  796                 0x0000000000005c00                __watchdog_support  797  *(.init2)  798  .init2         0x0000000000005c0c        0x4 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(__i#  799                 0x0000000000005c0c                __init_stack  800  *(.init3)  801  .init3         0x0000000000005c10        0x0 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(__l#  802                 0x0000000000005c10                __low_level_init  803  *(.init4)  804  .init4         0x0000000000005c10       0x18 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(_co#  805                 0x0000000000005c10                __do_copy_data  806  .init4         0x0000000000005c28       0x16 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(_cl#  807                 0x0000000000005c28                __do_clear_bss  808  *(.init5)                                                                                                                    809  *(.init6)  810  *(.init7)  811  *(.init8)  812  *(.init9)  813  .init9         0x0000000000005c3e       0x2c src\/simpleadd.o  814                 0x0000000000005c3e                main  815  *(.fini9)  816  .fini9         0x0000000000005c6a        0x0 \/usr\/local\/Cellar\/msp430-gcc\/4.7.0\/lib\/gcc\/msp430\/4.7.0\/mmpy-16\/libcrt0.a(__s#  817                 0x0000000000005c6a                __stop_progExec__ <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u043c\u043e\u0433\u0443 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0435\u0439\u0441\u043f\u0430\u043b\u043c\u043e\u0432, \u043f\u0440\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0445\u0441\u044f \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  \u041e\u0431 \u0430\u0432\u0442\u043e\u0440\u0435:<br \/>  \u0412\u0438\u043b\u044c\u044f\u043c \u0411\u0435\u043d\u043d\u0435\u0442\u0442<br \/>  \u042f \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0438\u043d\u0436\u0435\u043d\u0435\u0440-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0432 \u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438. \u042f \u043f\u0440\u043e\u0432\u043e\u0436\u0443 \u043d\u043e\u0447\u0438, \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u043d\u0430\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438 \u0438 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430\u043c\u0438 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430 \u0434\u043b\u044f \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. \u041c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0449\u0438.<\/p>\n<p>  \u041e\u0442 \u0441\u0435\u0431\u044f:<br \/>  \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u043c \u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u043c\u0430\u043d\u0443\u0430\u043b\u043e\u0432 \u0438 \u0434\u0430\u0442\u0430\u0448\u0438\u0442\u043e\u0432, \u0435\u0441\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u041b\u0438\u0447\u043d\u043e \u044f \u0434\u0430\u0432\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0432\u044f\u0437\u043a\u0443 LLVM-mspgcc, \u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u0435\u0448\u0430\u043b\u043e, \u0430 \u0442\u0443\u0442 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u043e\u0439\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e, \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043d\u0430 Ubuntu-msp430-gcc-mspdebug-TI LaunchPad.<br \/>  \u0422\u0430\u043a\u0436\u0435, \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438 OS X, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0442\u043e\u0436\u0435 \u043c\u043e\u0433\u0443 \u043d\u0435 \u0437\u043d\u0430\u0442\u044c (\u0432\u0435\u0440\u043d\u0435\u0435, \u043d\u0435 \u043c\u043e\u0433\u0443 \u0437\u043d\u0430\u0442\u044c). \u0422\u0430\u043a \u0447\u0442\u043e \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u043a\u0440\u0438\u0442\u0438\u043a\u0430 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430 \u0432\u0441\u0435, \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<p>  <sup>1<\/sup> \u2014 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e \u0442\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u0430\u0447\u043d\u043e. \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u043e\u0433\u043b\u0430\u0448\u0443\u0441\u044c.   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/241812\/\"> http:\/\/habrahabr.ru\/post\/241812\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">       \u0426\u0435\u043b\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u044d\u043a-\u044d\u043d\u0434\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 LLVM MSP430<\/p>\n<h1>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h1>\n<p>  CLANG \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0444\u0440\u043e\u043d\u0442-\u044d\u043d\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0421 \u0434\u043b\u044f LLVM. LLVM \u2014 \u044d\u0442\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u0440\u043e\u043d\u0442-\u044d\u043d\u0434\u043e\u0432, \u0431\u044d\u043a-\u044d\u043d\u0434\u043e\u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c. \u042d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0443\u0442\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0444\u0440\u043e\u043d\u0442-\u044d\u043d\u0434\u043e\u0432 \u043a \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e (IR). \u0412\u0441\u0435 \u0431\u044d\u043a-\u044d\u043d\u0434\u044b \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u044e\u0442 \u0441 \u044d\u0442\u0438\u043c \u043e\u0431\u0449\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>  \u041e\u0434\u043d\u0430 \u0438\u0437 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u0435\u043d\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442, \u044d\u0442\u043e MSP430 \u2014 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u043c\u0438\u043a\u0440\u043e\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445.<\/p>\n<p>  \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 MSP430 \u0432\u0435\u0441\u044c\u043c\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430. \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u043c\u043e\u0433\u0443 \u043f\u043e\u043c\u043e\u0447\u044c \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c, \u043a\u0442\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0444\u0435\u0439\u0441-\u043f\u0430\u043b\u043c\u0438\u0442, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043b\u0438\u0446\u043e. <sup>1<\/sup><\/p>\n<h1>\u041f\u043e\u0435\u0445\u0430\u043b\u0438<\/h1>\n<p>  \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044f \u0441\u043c\u043e\u0433\u0443 \u0432\u043e\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0431\u0435\u043b. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0430:  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-241812","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/241812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=241812"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/241812\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=241812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=241812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=241812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}