{"id":339145,"date":"2022-09-30T15:00:06","date_gmt":"2022-09-30T15:00:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=339145"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=339145","title":{"rendered":"<span>Rust \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043c\u0435\u0440\u0435\u0442\u044c, \u041c\u0413\u0423 \u0441\u0434\u0435\u043b\u0430\u043b \u0437\u0430\u043c\u0435\u0440\u044b<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0435\u0440\u0438\u044f\u0445:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/338268\/\">Go \u0431\u044b\u0441\u0442\u0440\u0435\u0435 Rust, Mail.Ru Group \u0441\u0434\u0435\u043b\u0430\u043b\u0430 \u0437\u0430\u043c\u0435\u0440\u044b<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/492410\/\">C++ \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435 Rust, Yandex \u0441\u0434\u0435\u043b\u0430\u043b\u0430 \u0437\u0430\u043c\u0435\u0440\u044b<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u043d\u043e \u0432\u0435\u0440\u043d\u043e \u0420\u0430\u0441\u0442 \u043f\u0440\u043e\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0443\u043c\u044b \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0446\u0438\u0439, \u043d\u043e \u0438 \u0432 \u0443\u043c\u044b \u0448\u043a\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u0438 \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0442 \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u0430 \u041c\u0413\u0423: <a href=\"https:\/\/rustmustdie.com\/\" rel=\"nofollow noopener noreferrer\">https:\/\/rustmustdie.com\/<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0415\u0451 <a href=\"http:\/\/stolyarov.info\/node\/342\" rel=\"nofollow noopener noreferrer\">\u0440\u0435\u043f\u043e\u0441\u0442\u043d\u0443\u043b<\/a> \u0410\u043d\u0434\u0440\u0435\u0439 \u0412\u0438\u043a\u0442\u043e\u0440\u043e\u0432\u0438\u0447 \u0421\u0442\u043e\u043b\u044f\u0440\u043e\u0432, \u0434\u043e\u0446\u0435\u043d\u0442 \u043a\u0430\u0444\u0435\u0434\u0440\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u0444\u0430\u043a\u0443\u043b\u044c\u0442\u0435\u0442\u0430 \u0412\u041c\u041a \u041c\u0413\u0423 \u0438\u043c. \u041c. \u0412. \u041b\u043e\u043c\u043e\u043d\u043e\u0441\u043e\u0432\u0430 \u0438 \u043f\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0443 \u043d\u0430\u0443\u0447\u0440\u0443\u043a \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u0430-\u0430\u0432\u0442\u043e\u0440\u0430 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  <\/p>\n<blockquote><p>\u042f \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0442\u0443\u0442 \u0434\u0435\u043b\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d &#171;\u043d\u0435\u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u044b\u0439&#187;. \u0414\u0435\u043b\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0440\u0430\u0441\u0442\u0430 \u0441\u0430\u043c \u0440\u0435\u0448\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u043b\u0430\u0434\u0435\u043d\u0438\u0435 &#171;\u0434\u043e\u043b\u0436\u043d\u043e&#187; (\u0441 \u0435\u0433\u043e, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f) \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443. \u0410 \u0440\u0435\u0448\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u0430 \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440. \u041d\u0443 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043f\u043b\u044f\u0441\u043a\u0430 \u0432\u0438\u0434\u0430 &#171;\u043a\u0430\u043a \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0443\u043f\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u0439\u043b\u0435\u0440 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e, \u0447\u0435\u0433\u043e \u044f \u0445\u043e\u0447\u0443&#187;.<br \/>  \u0411\u0440\u0435\u0434 \u044d\u0442\u043e \u0432\u0441\u0451.<\/p>\n<p>   \u2014 \u0410. \u0412. \u0421\u0442\u043e\u043b\u044f\u0440\u043e\u0432<\/p><\/blockquote>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0421\u0430\u043c\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043a\u043e\u0440\u043e\u0442\u043a\u0430\u044f, \u043d\u043e \u043f\u043e\u0441\u0442\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043f\u043e\u0440\u043d\u044b\u0445 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0435\u043e\u0442\u0434\u0435\u043b\u0438\u043c\u0430 \u043e\u0442 \u044f\u0437\u044b\u043a\u0430<\/li>\n<li>\u0423 \u043d\u0435\u0433\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0440\u0430\u043d\u0442\u0430\u0439\u043c<\/li>\n<li>\u0412 Rust \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430<\/li>\n<li>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0430\u0431\u0440\u043e\u0441\u043e\u0432 \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435, \u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0434\u043b\u044f \u043e\u043f\u0440\u043e\u0432\u0435\u0440\u0436\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u043c\u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u0440\u043e\u0434\u0441\u043a\u0438\u0435 \u0445\u044d\u043b\u043b\u043e \u0432\u043e\u0440\u043b\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<h1 id=\"soderzhanie\">\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h1>\n<ul>\n<li><a href=\"#para_1\">\u041e\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u0430\u043c\u044b\u0439 \u043d\u0438\u0437<\/a><br \/> \n<ul>\n<li><a href=\"#para_2\">\u041d\u0443\u043b\u0435\u0432\u043e\u0439 \u0440\u0430\u043d\u0442\u0430\u0439\u043c \u0432 \u0421\u0438<\/a><\/li>\n<li><a href=\"#para_3\">\u0418\u0437 \u0447\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0445\u044d\u043b\u043b\u043e \u0432\u043e\u0440\u043b\u0434<\/a><\/li>\n<li><a href=\"#para_4\">\u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c std<\/a><\/li>\n<li><a href=\"#para_5\">\u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c core<\/a><\/li>\n<li><a href=\"#para_6\">\u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c crt<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#para_7\">\u041f\u0438\u0448\u0435\u043c \u0445\u044d\u043b\u043b\u043e \u0432\u043e\u0440\u043b\u0434<\/a><br \/> \n<ul>\n<li><a href=\"#para_8\">\u0421\u0438\u043c\u0432\u043e\u043b _start<\/a><\/li>\n<li><a href=\"#para_9\">\u0421\u0438\u0441\u043a\u043e\u043b\u044b<\/a><\/li>\n<li><a href=\"#para_10\">\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430<\/a><\/li>\n<li><a href=\"#para_11\">\u0417\u0430\u043f\u0438\u0441\u044c \u0432 \u0444\u0430\u0439\u043b<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#para_12\">\u041f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043a \u043e\u0431\u0449\u0435\u043c\u0443 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044e<\/a><br \/> \n<ul>\n<li><a href=\"#para_13\">\u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c gcc \u0438 rustc_codegen_gcc<\/a><\/li>\n<li><a href=\"#para_14\">\u0425\u044d\u043b\u043b\u043e \u0432\u043e\u0440\u043b\u0434 \u043d\u0430 \u0421\u0438 \u043f\u043e\u0434 i386<\/a><\/li>\n<li><a href=\"#para_15\">\u0425\u044d\u043b\u043b\u043e \u0432\u043e\u0440\u043b\u0434 \u043d\u0430 \u0420\u0430\u0441\u0442\u0435 \u043f\u043e\u0434 i386<\/a><\/li>\n<li><a href=\"#para_16\">\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#para_17\">\u0412\u044b\u0432\u043e\u0434\u044b<\/a><\/li>\n<li><a href=\"#para_18\">\u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043a\u043e\u0434<\/a><\/li>\n<\/ul>\n<p>  <a name=\"para_1\"><\/a>  <\/p>\n<h1 id=\"opuskaemsya-na-samyy-niz\">\u041e\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u0430\u043c\u044b\u0439 \u043d\u0438\u0437<\/h1>\n<p>  <a name=\"para_2\"><\/a>  <\/p>\n<h2 id=\"nulevoy-rantaym-v-si\">\u041d\u0443\u043b\u0435\u0432\u043e\u0439 \u0440\u0430\u043d\u0442\u0430\u0439\u043c \u0432 \u0421\u0438<\/h2>\n<p>  <\/p>\n<p>\u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0434\u043e \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u0442\u0430\u043a\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u043a zero runtime. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0433\u0443\u0433\u043b\u0438\u0432, \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043a\u043d\u0438\u0433\u0443 \u0410. \u0412. \u0421\u0442\u043e\u043b\u044f\u0440\u043e\u0432\u0430 ISBN 978-5-317-06575-7 <a href=\"http:\/\/www.stolyarov.info\/books\/pdf\/progintro_e2v2.pdf\" rel=\"nofollow noopener noreferrer\">\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435: \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044e. II: \u0421\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0441\u0435\u0442\u0438<\/a>, \u0438\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0432 2021 \u0433\u043e\u0434\u0443. \u0412 \u0433\u043b\u0430\u0432\u0435 &#171;\u00a74.12: (*) \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 \u0421\u0438 \u0431\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438&#187; \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0434\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b <code>_start<\/code> (\u043f\u043e\u0434 Linux i386):<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">start.asm<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">global _start       ; no_libc\/start.asm extern main section     .text _start:     mov ecx, [esp]  ; argc in ecx     mov eax, esp     add eax, 4      ; argv in eax     push eax     push ecx     call main     add esp, 8      ; clean the stack     mov ebx, eax    ; now call _exit     mov eax, 1     int 80h<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c \u0441 &#171;\u043e\u0431\u0435\u0440\u0442\u043a\u0430\u043c\u0438&#187; \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">calls.asm<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">global sys_read     ; no_libc\/calls.asm global sys_write global sys_errno  section .text  generic_syscall_3:     push ebp     mov ebp, esp     push ebx     mov ebx, [ebp+8]     mov ecx, [ebp+12]     mov edx, [ebp+16]     int 80h     mov edx, eax     and edx, 0fffff000h     cmp edx, 0fffff000h     jnz .okay     mov [sys_errno], eax     mov eax, -1 .okay:     pop ebx     mov esp, ebp     pop ebp     ret  sys_read:     mov eax, 3     jmp generic_syscall_3  sys_write:     mov eax, 4     jmp generic_syscall_3  section .bss sys_errno resd 1<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u043a\u0430\u043a \u0438\u043c\u044f \u0438 \u0437\u0434\u043e\u0440\u043e\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c, \u0447\u044c\u0451 \u0438\u043c\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0444\u0440\u0430\u0437\u043e\u0439 <strong>Hello, dear NNN<\/strong> (\u0438\u043c\u044f \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u043e NNN):<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">greet3.c<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/* no_libc\/greet3.c *\/ int sys_write(int fd, const void *buf, int size);  static const char dunno[] = \"I don't know how to greet you\\n\"; static const char hello[] = \"Hello, dear \";  static int string_length(const char *s) {   int i = 0;   while(s[i])     i++;   return i; }  int main(int argc, char **argv) {   if(argc &lt; 2) {     sys_write(1, dunno, sizeof(dunno)-1);     return 1;   }   sys_write(1, hello, sizeof(hello)-1);   sys_write(1, argv[1], string_length(argv[1]));   sys_write(1, \"\\n\", 1);   return 0; }<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0418 \u0441\u0430\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">nasm -f elf start.asm nasm -f elf calls.asm gcc -m32 -Wall -c greet3.c ld -melf_i386 start.o calls.o greet3.o -o greet3<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435 \u0430\u0432\u0442\u043e\u0440\u0430 \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u043e\u043a (\u0421\u0442\u043e\u043b\u044f\u0440\u043e\u0432\u0430) \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b 816 \u0431\u0430\u0439\u0442. \u041d\u0430 \u043c\u043e\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 13472 \u0431\u0430\u0439\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0436, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c <code>clang-14<\/code>, <code>ld.lld-14<\/code>, <code>-Os<\/code> \u0438 <code>strip<\/code>; \u0438 \u043d\u0430 \u043c\u043e\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c 1132 \u0431\u0430\u0439\u0442\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">nasm -f elf start.asm nasm -f elf calls.asm clang-14 -m32 -Os -Wall -c greet3.c ld.lld-14 -melf_i386 start.o calls.o greet3.o -o greet3 strip .\/greet3<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0441\u0432\u043e\u0435\u0439 \u043a\u043d\u0438\u0433\u0435 \u0421\u0442\u043e\u043b\u044f\u0440\u043e\u0432 \u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<p>  <\/p>\n<blockquote><p>\u041d\u043e \u0434\u0435\u043b\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u0432 \u044d\u0442\u043e\u0439 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 (\u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u2014 \u041f\u0440\u0438\u043c. \u0430\u0432\u0442.)\u2026<br \/>  \u041d\u0430\u043c\u043d\u043e\u0433\u043e \u0432\u0430\u0436\u043d\u0435\u0435 \u0441\u0430\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f: <strong>\u044f\u0437\u044b\u043a \u0421\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/strong>. \u041a\u0440\u043e\u043c\u0435 \u0421\u0438, \u0442\u0430\u043a\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u2014 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0439 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043e\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0442\u0430\u043a\u0436\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u043c <em>zero runtime<\/em> \u2014 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u044f\u0437\u044b\u043a\u0438 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043e\u0432; \u043d\u0438 \u043e\u0434\u0438\u043d \u044f\u0437\u044b\u043a \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p><\/blockquote>\n<p>\u0427\u0442\u043e \u0436, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043b\u0438 \u0420\u0430\u0441\u0442 \u0442\u0430\u043a\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c.<\/p>\n<p>  <a name=\"para_3\"><\/a>  <\/p>\n<h2 id=\"iz-chego-sostoit-hello-vorld\">\u0418\u0437 \u0447\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0445\u044d\u043b\u043b\u043e \u0432\u043e\u0440\u043b\u0434<\/h2>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 \u044f\u0437\u044b\u043a\u0430 \u0420\u0430\u0441\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">fn main() {   println!(\"Hello, world!\"); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a <code>println!<\/code> \u2014 \u044d\u0442\u043e \u043c\u0430\u043a\u0440\u043e\u0441, \u0430 \u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 <a href=\"https:\/\/lib.rs\/crates\/cargo-expand\" rel=\"nofollow noopener noreferrer\">cargo-expand<\/a>: <\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#![feature(prelude_import)] #[prelude_import] use std::prelude::rust_2021::*; #[macro_use] extern crate std; fn main() {   {     ::std::io::_print(::core::fmt::Arguments::new_v1(       &amp;[\"Hello, world!\\n\"],       &amp;match () {         _args => [],       },     ));   }; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u0441\u0442\u0430\u0432\u0438\u043b \u0438\u043c\u043f\u043e\u0440\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>extern crate std;<\/code> \u0438 <a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/prelude\/index.html\" rel=\"nofollow noopener noreferrer\">\u043f\u0440\u0435\u043b\u044e\u0434\u0438\u044e<\/a> <code>use std::prelude::rust_2021::*;<\/code>. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438 \u043d\u0435\u044f\u0432\u043d\u044b\u0435 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u044f \u0438 \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u2014 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438 \u0442\u0438\u043f\u0430\u0436\u0435\u0439 \u0432 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0443 \u0442\u0435\u0431\u044f \u0435\u0441\u0442\u044c \u043e\u0441, \u0444\u0441, \u043a\u0443\u0447\u0430, \u0441\u043e\u043a\u0435\u0442\u044b \u0438 \u043f\u0440\u043e\u0447\u0430\u044f \u0445\u0438\u043f\u0441\u0442\u043e\u0442\u0430. \u0421\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e 93.9% \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 (\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 std \u0438 \u043f\u0440\u0435\u043b\u044e\u0434\u0438\u0438) \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412\u0435\u0441\u044c API \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d \u0432 <a href=\"https:\/\/doc.rust-lang.org\/stable\/std\/\" rel=\"nofollow noopener noreferrer\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0415\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0431\u044b\u0441\u0442\u0440\u043e\u043f\u043e\u0438\u0441\u043a: <code>https:\/\/std.rs\/QUERY<\/code>, \u0433\u0434\u0435 <code>QUERY<\/code> \u2014 \u0432\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/std.rs\/mutex\" rel=\"nofollow noopener noreferrer\">https:\/\/std.rs\/mutex<\/a>.<\/p>\n<p>  <a name=\"para_4\"><\/a>  <\/p>\n<h2 id=\"otklyuchaem-std\">\u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c std<\/h2>\n<p>  <\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 19% \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0440\u0435\u0436\u0438\u043c \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <code>#![no_std]<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#![no_std] #![feature(start, lang_items)]  \/\/ \u0413\u043e\u0432\u043e\u0440\u0438\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0432\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u0442\u044c libc #[cfg(target_os = \"linux\")] #[link(name = \"c\")]  extern \"C\" {   \/\/ \u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 libc   fn puts(s: *const u8) -> i32; }  #[start] \/\/ \u0413\u043e\u0432\u043e\u0440\u0438\u043c, \u0447\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u0434\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0441 \u044d\u0442\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 fn main(_argc: isize, _argv: *const *const u8) -> isize {   unsafe {     \/\/ \u0412 \u0420\u0430\u0441\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0435 \u043d\u0443\u043b\u044c-\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435     puts(\"Hello, world!\\0\".as_ptr());   }   return 0; }  #[panic_handler] \/\/ \u0423\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 fn panic(_panic: &amp;core::panic::PanicInfo&lt;'_>) -> ! {   loop {} }  #[lang = \"eh_personality\"] \/\/ \u0423\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 extern \"C\" fn eh_personality() {}<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0437\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u043a\u043e\u0434 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0444\u0438\u0447, \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0432\u043e\u0442\u043a\u043d\u0443\u0442\u044c \u0432 \u043a\u043e\u0440\u0435\u043d\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <a href=\"https:\/\/rust-lang.github.io\/rustup\/overrides.html\" rel=\"nofollow noopener noreferrer\">\u0444\u0430\u0439\u043b\u0438\u043a<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ cat rust-toolchain.toml  [toolchain] channel = \"nightly-2022-06-09\"<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u043d\u0430 \u043a\u043e\u043c\u043f\u0435 \u043d\u0435\u0442, \u0442\u043e <code>cargo<\/code> \u0432\u044b\u0437\u043e\u0432\u0435\u0442 <code>rustup<\/code>, \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0435\u0441\u0442\u044c, \u0442\u043e \u043b\u044e\u0431\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 <code>cargo<\/code> \u043f\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u0432\u0435\u0440\u0441\u0438\u044e.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0432 <code>Cargo.toml<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u043e\u0442\u043a\u0438, \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u043d\u0430 \u0432 \u043a\u043e\u0434\u0435 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[profile.dev] panic = \"abort\"  [profile.release] panic = \"abort\"<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0445\u044d\u043b\u043b\u043e \u0432\u043e\u0440\u043b\u0434\u0430 <code>cargo-expand<\/code> \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#[prelude_import] use core::prelude::rust_2021::*; #[macro_use] extern crate core; ...<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435\u044f\u0432\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u043b \u0438\u043c\u043f\u043e\u0440\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 core (<code>extern crate core;<\/code>) \u0438 <a href=\"https:\/\/doc.rust-lang.org\/stable\/core\/prelude\/index.html\" rel=\"nofollow noopener noreferrer\">\u043f\u0440\u0435\u043b\u044e\u0434\u0438\u044e core<\/a> (<code>use core::prelude::rust_2021::*;<\/code>).<\/p>\n<p>  <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u0432\u043e\u0434\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 <code>core<\/code> \u0438 <code>std<\/code>.<\/p>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/th>\n<th><code>core<\/code><\/th>\n<th><code>std<\/code><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438<\/td>\n<td>\u043d\u0435\u0442 <strong>*1<\/strong><\/td>\n<td>\u0434\u0430<\/td>\n<\/tr>\n<tr>\n<td>\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 (<code>Vec<\/code>, <code>HashMap<\/code> \u0438 \u0442.\u0434.)<\/td>\n<td>\u043d\u0435\u0442 <strong>*2<\/strong><\/td>\n<td>\u0434\u0430<\/td>\n<\/tr>\n<tr>\n<td>\u0434\u043e\u0441\u0442\u0443\u043f \u043a <code>std<\/code><\/td>\n<td>\u043d\u0435\u0442<\/td>\n<td>\u0434\u0430<\/td>\n<\/tr>\n<tr>\n<td>\u0434\u043e\u0441\u0442\u0443\u043f \u043a <code>core<\/code><\/td>\n<td>\u0434\u0430<\/td>\n<td>\u0434\u0430<\/td>\n<\/tr>\n<tr>\n<td>\u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/td>\n<td>\u0434\u0430<\/td>\n<td>\u043d\u0435\u0442<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  <\/p>\n<ol>\n<li>\u0434\u0430, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0440\u0435\u0439\u0442 <code>alloc<\/code> \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440;<\/li>\n<li>\u0434\u0430, \u0435\u0441\u043b\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0442\u043e\u0436\u0435 <code>#![no_std]<\/code> \u0438 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 <code>core<\/code>.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438 \u0442\u0438\u043f\u0430\u0436\u0435\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0432 <code>core<\/code>, \u0430 \u043d\u0435 \u0432 <code>std<\/code>:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041c\u0435\u0442\u043e\u0434\u044b \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432 <code>bool<\/code>, <code>i32<\/code>&#8230;;<\/li>\n<li>\u0422\u0438\u043f\u044b <code>Range<\/code>, <code>Option<\/code>, <code>Result<\/code>, <code>Cell<\/code>, <code>RefCell<\/code>, <code>PhantomData<\/code>&#8230;;<\/li>\n<li>\u0422\u0438\u043f\u0430\u0436\u0438 <code>Hash<\/code>, <code>Drop<\/code>, <code>Debug<\/code>, <code>Iterator<\/code>, <code>Future<\/code>, <code>Unpin<\/code>&#8230;;<\/li>\n<li>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 <code>forget<\/code>, <code>drop<\/code>, <code>swap<\/code>&#8230;<\/li>\n<\/ul>\n<p>  <a name=\"para_5\"><\/a>  <\/p>\n<h2 id=\"otklyuchaem-core\">\u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c core<\/h2>\n<p>  <\/p>\n<p>\u041c\u044b \u043d\u0435 \u0438\u0449\u0435\u043c \u043b\u0451\u0433\u043a\u0438\u0445 \u043f\u0443\u0442\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043c \u0438 <code>std<\/code>, \u0438 <code>core<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <code>#![no_core]<\/code>. \u0422\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u043e\u0446\u0435\u043d\u043a\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0442 3577 \u0434\u043e 4518 \u043b\u044e\u0434\u044f\u043c \u0432 \u043c\u0438\u0440\u0435 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 (\u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043b\u044e\u0434\u0435\u0439 \u043a\u043e\u043d\u0442\u0440\u0438\u0431\u0443\u0442\u044f\u0442 \u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0420\u0430\u0441\u0442\u0430, \u043d\u043e github \u0434\u0430\u0451\u0442 \u043e\u0434\u043d\u0438 \u0446\u0438\u0444\u0440\u044b, \u0430 <code>git log --format=\"%an\" | sort -u | wc -l<\/code> \u0434\u0440\u0443\u0433\u0438\u0435). \u0412\u044b \u0436\u0435 \u043d\u0435 \u0434\u0443\u043c\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u044f \u0442\u0443\u0442 \u0431\u0435\u0440\u0443 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0441 \u043f\u043e\u0442\u043e\u043b\u043a\u0430?<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#![feature(no_core)] #![feature(lang_items)]  #![no_core]  \/\/ \u0413\u043e\u0432\u043e\u0440\u0438\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u0432\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u0442\u044c libc #[cfg(target_os = \"linux\")] #[link(name = \"c\")] extern {}  \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f `main` \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435 \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430, \u0430 \u0432\u043e\u0442 `start` - \u0434\u0430. #[lang = \"start\"] fn start&lt;T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8) -> isize {   42 }  \/\/ \u0412\u0442\u044b\u043a\u0430\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 undefined reference to `main' fn main() { }  \/\/ \u041d\u0443\u0436\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 #[lang = \"sized\"] pub trait Sized {}<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043a\u043e\u0434\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430: <code>echo $?<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0440\u043d\u0443\u0442\u044c 42.<\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u043f\u043e\u0447\u0442\u0438 \u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0434\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0438\u0437\u0430. \u0423 \u043d\u0430\u0441 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0430, \u0435\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0441\u043b\u043e\u0436\u0438\u0442\u044c, \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">error[E0369]: cannot add `{integer}` to `{integer}`   --> src\/main.rs:14:8    | 14 |     40 + 2    |     -- ^ - {integer}    |     |    |     {integer}<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442, \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432 <code>i8<\/code>, <code>usize<\/code>, <code>str<\/code>, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c\u0438 \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<p>  <a name=\"para_6\"><\/a>  <\/p>\n<h2 id=\"otklyuchaem-crt\">\u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c crt<\/h2>\n<p>  <\/p>\n<p>Rust \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 (\u043e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439) \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 <code>*crt*.o<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b (<code>_start<\/code>), \u043d\u043e \u044d\u0442\u043e\u0442 \u0441\u0438\u043c\u0432\u043e\u043b \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u0438\u0448\u043d\u044b\u0439 \u0440\u0430\u043d\u0442\u0430\u0439\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ cargo rustc -- -C link-args=-nostartfiles<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0444\u043b\u0430\u0433\u0438 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ cat .cargo\/config  [build] rustflags = [\"-C\", \"link-args=-nostartfiles\"]<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u0441 <code>.cargo\/config<\/code> \u0438 <code>rust-toolchain.toml<\/code> \u0444\u0430\u0439\u043b\u043e\u043c \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>cargo build<\/code>. \u041d\u0443 \u0438\u043b\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0431\u0438\u0432\u0430\u0442\u044c <code>cargo +nightly-2022-06-09 rustc -- -C link-args=-nostartfiles<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0412\u0438\u0434 \u043d\u0430\u0448\u0435\u0433\u043e \u0445\u044d\u043b\u043b\u043e \u0432\u043e\u0440\u043b\u0434\u0430 \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0442\u0430\u0435\u0442 \u0444\u043e\u0440\u043c\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#![feature(no_core)] #![feature(lang_items)] #![no_core] #![no_main]  #[no_mangle] extern \"C\" fn _start() {}  \/\/ \u041d\u0443\u0436\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 #[lang = \"sized\"] pub trait Sized {}<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0435\u0432\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ objdump -Cd .\/target\/debug\/hello_world  .\/target\/debug\/hello_world:     file format elf64-x86-64  Disassembly of section .text:  0000000000001000 &lt;_start>:     1000:   c3                      retq<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ cargo run     Finished dev [unoptimized + debuginfo] target(s) in 0.00s      Running `target\/debug\/hello_world` Illegal instruction (core dumped)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e. \u0421 \u044d\u0442\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p>  <a name=\"para_7\"><\/a>  <\/p>\n<h1 id=\"pishem-hello-vorld\">\u041f\u0438\u0448\u0435\u043c \u0445\u044d\u043b\u043b\u043e \u0432\u043e\u0440\u043b\u0434<\/h1>\n<p>  <\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435 \u0434\u043e \u043c\u0435\u0439\u043d\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e: \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u043a\u043e\u0432, \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430. \u0421\u043e\u0432\u0435\u0442\u0443\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u043e\u043a\u043b\u0430\u0434 \u041c\u044d\u0442\u0442\u0430 \u0413\u043e\u0434\u0431\u043e\u043b\u0442\u0430:<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=dOfucXtyEsU\" rel=\"nofollow noopener noreferrer\">https:\/\/www.youtube.com\/watch?v=dOfucXtyEsU<\/a><\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u0436\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <code>_start<\/code> \u0441 \u043f\u0440\u044b\u0436\u043a\u043e\u043c \u0432 <code>_start_main<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>main<\/code>. \u041f\u043e\u0434\u043b\u043e\u0436\u043a\u0430 \u0432 \u0432\u0438\u0434\u0435 <code>_start_main<\/code> \u043d\u0443\u0436\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0441\u0442\u0435\u043a\u0430.<\/p>\n<p>  <a name=\"para_8\"><\/a>  <\/p>\n<h2 id=\"simvol-_start\">\u0421\u0438\u043c\u0432\u043e\u043b _start<\/h2>\n<p>  <\/p>\n<p>\u0415\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435. \u0412 <code>std<\/code>\/<code>core<\/code> \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0445 \u0432\u0441\u0442\u0430\u0432\u043e\u043a \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0430 \u0432\u043e\u0442 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u044f\u0432\u043d\u043e.<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#![feature(decl_macro)] #![feature(rustc_attrs)] #[rustc_builtin_macro] pub macro asm(\"assembly template\", $(operands,)* $(options($(option),*))?) {   \/* compiler built-in *\/ }<\/code><\/pre>\n<p>  <\/p>\n<p><code>_start<\/code> \u2014 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043b\u043e\u0433 \u0438 \u044d\u043f\u0438\u043b\u043e\u0433, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0435 \u043d\u0430\u0434\u043e \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u043a\u0430\u043a <code>naked<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#![feature(naked_functions)]  #[no_mangle] #[naked] unsafe extern \"C\" fn _start() {   \/\/ \u0421\u0442\u044b\u0440\u0435\u043d\u043e \u0438\u0437 \u043a\u043d\u0438\u0433\u0438 \u0410.\u0412. \u0421\u0442\u043e\u043b\u044f\u0440\u043e\u0432\u0430.   \/\/ \u0410, \u043f\u0440\u043e\u0441\u0442\u0438\u0442\u0435, \u0442\u0430\u043c \u043a\u043e\u0434 \u043f\u043e\u0434 32 \u0431\u0438\u0442\u0430, \u0432 \u043a\u043d\u0438\u0433\u0435 2021 \u0433\u043e\u0434\u0430.   \/\/ \u0417\u043d\u0430\u0447\u0438\u0442, \u043d\u0435 \u0441\u0442\u044b\u0440\u0435\u043d\u043e.   asm!(     \"mov rdi, [rsp]\", \/\/ argc     \"mov rax, rsp\",     \"add rax, 8\",     \"mov rsi, rax\", \/\/ argv     \"call _start_main\",     options(noreturn),   ) }  #[no_mangle] extern \"C\" fn _start_main(argc: usize, argv: *const *const u8) -> isize {   main(argc, argv);   0 }  #[no_mangle] fn main(_argc: usize, _argv: *const *const u8) -> isize {   \/\/ \u0418 \u0432\u043e\u0442 \u043c\u044b \u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0434\u043e \u043c\u0435\u0439\u043d\u0430   return 0; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c: <code>Illegal instruction (core dumped)<\/code>. \u042f \u0447\u0443\u044e, \u0447\u0442\u043e \u043c\u044b \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u0443\u0442\u0438!<\/p>\n<p>  <a name=\"para_9\"><\/a>  <\/p>\n<h2 id=\"siskoly\">\u0421\u0438\u0441\u043a\u043e\u043b\u044b<\/h2>\n<p>  <\/p>\n<p>\u0412\u0441\u0435\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u0432\u0430 \u0441\u0438\u0441\u043a\u043e\u043b\u0430: <code>exit<\/code> \u0438 <code>write<\/code>.<\/p>\n<p>  <\/p>\n<p>&#171;\u041f\u043e\u0434\u043b\u043e\u0436\u043a\u0438&#187; \u0434\u043b\u044f \u0441\u0438\u0441\u043a\u043e\u043b\u043b\u043e\u0432 \u044f \u0445\u043e\u0447\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0431\u0449\u0435\u043c \u0432\u0438\u0434\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0438 \u043d\u043e\u043c\u0435\u0440 \u0441\u0438\u0441\u043a\u043e\u043b\u043b\u0430 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b (<code>syscall1<\/code> \u2014 1 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, <code>syscall3<\/code> \u2014 3 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430).<\/p>\n<p>  <\/p>\n<p><code>man 2 syscall<\/code> \u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">Architecture calling conventions<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">Every  architecture has its own way of invoking and passing arguments to the kernel.  The details for various architectures are listed in the two tables below.  The first table lists the instruction used to transition to kernel mode (which might not be the fastest or best way to transition to the kernel, so  you might have to refer to vdso(7)), the register used to indicate the system call number, the register(s) used to return the system call result, and the register used to signal an error.  Arch\/ABI    Instruction           System  Ret  Ret  Error    Notes                                   call #  val  val2 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 i386        int $0x80             eax     eax  edx  - x86-64      syscall               rax     rax  rdx  -        5  The second table shows the registers used to pass the system call arguments.  Arch\/ABI      arg1  arg2  arg3  arg4  arg5  arg6  arg7  Notes \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 i386          ebx   ecx   edx   esi   edi   ebp   - x86-64        rdi   rsi   rdx   r10   r8    r9    -<\/code><\/pre>\n<\/div><\/div>\n<p>  <a name=\"para_10\"><\/a>  <\/p>\n<h2 id=\"zavershenie-processa\">\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430<\/h2>\n<p>  <\/p>\n<p>\u0423 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0435\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u2014 \u043e\u043d \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f. \u042d\u0442\u043e\u0442 \u0444\u0430\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0438\u043f\u043e\u0432 \u0438 \u0438\u043d\u0442\u0440\u0438\u043d\u0437\u0438\u043a\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443, \u0447\u0442\u043e \u043b\u044e\u0431\u043e\u0439 \u043a\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0438\u0441\u043a\u043e\u043b\u0430 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d. \u042d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0442\u0438\u043f <code>!<\/code> (never) \u0438 \u0438\u043d\u0442\u0440\u0438\u043d\u0437\u0438\u043a <code>unreachable<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#![feature(intrinsics)] \/\/ \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u0438\u0447\u0443 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0440\u0438\u043d\u0437\u0438\u043a\u043e\u0432  extern \"rust-intrinsic\" {   \/\/ \u0427\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0447\u044c.   \/\/ \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 exit()   pub fn unreachable() -> !; }  #[no_mangle] extern \"C\" fn _start_main(argc: usize, argv: *const *const u8) -> ! {   let status = main(argc, argv);   exit(status); }  #[inline(never)] #[no_mangle] \/\/ ! - \u044d\u0442\u043e never type, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f fn exit(exit_code: i64) -> ! {   unsafe {     syscall1(60, exit_code);     unreachable()   } }  #[inline(always)] unsafe fn syscall1(n: i64, a1: i64) -> i64 {   let ret: i64;   asm!(     \"syscall\",     in(\"rax\") n,     in(\"rdi\") a1,     lateout(\"rax\") ret,   );   ret }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a, <code>echo $?<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 0.<\/p>\n<p>  <a name=\"para_11\"><\/a>  <\/p>\n<h2 id=\"zapis-v-fayl\">\u0417\u0430\u043f\u0438\u0441\u044c \u0432 \u0444\u0430\u0439\u043b<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 &#171;Hello, world!&#187; \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u0432\u043e\u0434\u0430! \\&lt;\u041d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u043c\u0435\u043d\u0435\u0435 \u0433\u043b\u0443\u043f\u0443\u044e \u0444\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0434 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0435\u0439>.<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#[no_mangle] fn main(_argc: usize, _argv: *const *const u8) -> i64 {   let string = b\"Hello, world!\\n\" as *const _ as *const u8;   write(1, string, 14);   return 0; }  #[inline(never)] #[no_mangle] fn write(fd: i64, data: *const u8, len: i64) -> i64 {   unsafe { syscall3(1, fd, data as i64, len) } }  #[inline(always)] unsafe fn syscall3(n: i64, a1: i64, a2: i64, a3: i64) -> i64 {   let ret: i64;   asm!(     \"syscall\",     in(\"rax\") n,     in(\"rdi\") a1,     in(\"rsi\") a2,     in(\"rdx\") a3,     lateout(\"rax\") ret,   );   ret }<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0425\u0435\u043b\u043b\u043e \u0432\u043e\u0440\u043b\u0434 \u043d\u0430 \u0420\u0430\u0441\u0442\u0435 \u043f\u043e\u0434 Linux x86_64 \u0446\u0435\u043b\u0438\u043a\u043e\u043c<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"rust\">#![feature(no_core)] #![feature(lang_items)] #![no_core] #![no_main] #![feature(naked_functions)] #![feature(decl_macro)] #![feature(rustc_attrs)] #![feature(intrinsics)]  \/\/ \u041d\u0443\u0436\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 #[lang = \"sized\"] pub trait Sized {}  #[lang = \"copy\"] pub trait Copy {}  impl Copy for i64 {} \/\/ \u0413\u043e\u0432\u043e\u0440\u0438\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0439\u0442 \u0437\u0430 \u0431\u0430\u0439\u0442\u043e\u043c impl Copy for usize {}  #[rustc_builtin_macro] pub macro asm(\"assembly template\", $(operands,)* $(options($(option),*))?) {   \/* compiler built-in *\/ }  extern \"rust-intrinsic\" {   \/\/ \u0427\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0447\u044c.   \/\/ \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u043e\u0441\u043b\u0435 exit()   pub fn unreachable() -> !; }  #[no_mangle] #[naked] unsafe extern \"C\" fn _start() {   \/\/ \u0421\u0442\u044b\u0440\u0435\u043d\u043e \u0438\u0437 \u043a\u043d\u0438\u0433\u0438 \u0410.\u0412. \u0421\u0442\u043e\u043b\u044f\u0440\u043e\u0432\u0430.   \/\/ \u0410, \u043f\u0440\u043e\u0441\u0442\u0438\u0442\u0435, \u0442\u0430\u043c \u043a\u043e\u0434 \u043f\u043e\u0434 32 \u0431\u0438\u0442\u0430, \u0432 \u043a\u043d\u0438\u0433\u0435 2021 \u0433\u043e\u0434\u0430.   \/\/ \u0417\u043d\u0430\u0447\u0438\u0442, \u043d\u0435 \u0441\u0442\u044b\u0440\u0435\u043d\u043e.   asm!(     \"mov rdi, [rsp]\", \/\/ argc     \"mov rax, rsp\",     \"add rax, 8\",     \"mov rsi, rax\", \/\/ argv     \"call _start_main\",     options(noreturn),   ) }  #[no_mangle] extern \"C\" fn _start_main(argc: usize, argv: *const *const u8) -> ! {   let status = main(argc, argv);   exit(status); }  #[no_mangle] fn main(_argc: usize, _argv: *const *const u8) -> i64 {   let string = b\"Hello, world!\\n\" as *const _ as *const u8;   write(1, string, 14);   return 0; }  #[inline(never)] #[no_mangle] \/\/ ! - \u044d\u0442\u043e never type, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f fn exit(status: i64) -> ! {   unsafe {     syscall1(60, status);     unreachable()   } }  #[inline(never)] #[no_mangle] fn write(fd: i64, data: *const u8, len: i64) -> i64 {   unsafe { syscall3(1, fd, data as i64, len) } }  #[inline(always)] unsafe fn syscall1(n: i64, a1: i64) -> i64 {   let ret: i64;   asm!(     \"syscall\",     in(\"rax\") n,     in(\"rdi\") a1,     lateout(\"rax\") ret,   );   ret }  #[inline(always)] unsafe fn syscall3(n: i64, a1: i64, a2: i64, a3: i64) -> i64 {   let ret: i64;   asm!(     \"syscall\",     in(\"rax\") n,     in(\"rdi\") a1,     in(\"rsi\") a2,     in(\"rdx\") a3,     lateout(\"rax\") ret,   );   ret }<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ cargo r     Finished dev [unoptimized + debuginfo] target(s) in 0.01s      Running `target\/debug\/hello_world` Hello, world! $ echo $? 0 $ strip .\/target\/debug\/hello_world $ stat -c %s .\/target\/debug\/hello_world 13096<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u041d\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 13096 \u0431\u0430\u0439\u0442. \u0427\u0442\u043e \u0436, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c <code>ld.lld-14<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ cat .cargo\/config  [build] rustflags = [\"-C\", \"linker=ld.lld-14\"]<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ cargo r    Compiling hello_world v0.1.0 (\/home\/USER\/rustmustdie\/article\/chapter_4)     Finished dev [unoptimized + debuginfo] target(s) in 0.13s      Running `target\/debug\/hello_world` Hello, world! $ echo $? 0 $ strip .\/target\/debug\/hello_world $ stat -c %s .\/target\/debug\/hello_world 1712<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0438\u0438!<\/p>\n<p>  <\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u0442 =( \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c 1712 \u0431\u0430\u0439\u0442 \u043f\u0440\u043e\u0442\u0438\u0432 1132 \u0431\u0430\u0439\u0442 \u0441\u0438\u0448\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0432 \u0441\u0438\u0448\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u0434, \u043e\u043d \u0445\u0438\u0442\u0440\u044b\u0439, \u0441 \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u0443 \u043d\u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0440\u0430\u0437\u043c\u0435\u0440.<\/p>\n<p>  <a name=\"para_12\"><\/a>  <\/p>\n<h1 id=\"privodim-k-obschemu-znamenatelyu\">\u041f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043a \u043e\u0431\u0449\u0435\u043c\u0443 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044e<\/h1>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0415\u0434\u0438\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 (<code>gcc<\/code>),<\/li>\n<li>\u0415\u0434\u0438\u043d\u044b\u0439 \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a (<code>ld.lld-14<\/code>),<\/li>\n<li>\u041e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0444\u043b\u0430\u0433\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 <code>-Os -masm=intel -m32 -fno-pic -fno-asynchronous-unwind-tables<\/code>,<\/li>\n<li>\u041e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0444\u043b\u0430\u0433\u0438 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438 <code>--no-pie --no-dynamic-linker<\/code>,<\/li>\n<li>\u0414\u0430 \u0438 \u043a\u043e\u0434, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438?<\/li>\n<li>\u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b <code>_start<\/code> \u0441 \u043f\u0440\u044b\u0436\u043a\u043e\u043c \u0432 <code>_start_main<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>main<\/code>,<\/li>\n<li>\u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0434\u0432\u0430 \u0441\u0438\u0441\u043a\u043e\u043b\u0430 <code>sys_exit<\/code> \u0438 <code>sys_write<\/code> (\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 \u043a\u043d\u0438\u0433\u0438 \u0421\u0442\u043e\u043b\u044f\u0440\u043e\u0432\u0430),<\/li>\n<li>\u0427\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u043a\u043e\u043b\u043e\u0432 <code>syscall1<\/code> \u0438 <code>syscall3<\/code>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0416\u0430\u043b\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u044d\u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u2026 Or is it?<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/miro.medium.com\/max\/1400\/0*K4Phe3JokmDmxWeE\" title=\"Hey Vsauce, Michael Here\"\/><br \/>  <a name=\"para_13\"><\/a>  <\/p>\n<h2 id=\"kompiliruem-gcc-i-rustc_codegen_gcc\">\u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c gcc \u0438 rustc_codegen_gcc<\/h2>\n<p>  <\/p>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 <code>rustc<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u043a\u0435\u043d\u0434 <code>llvm<\/code>, \u043d\u043e \u0438 <code>gcc<\/code>. \u041f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 <code>gcc<\/code>, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/rust-lang\/rustc_codegen_gcc\" rel=\"nofollow noopener noreferrer\">rustc_codegen_gcc<\/a>. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043d\u0435 \u0432\u0441\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e, \u0441 \u043d\u0438\u043c \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u043e\u0444\u0435\u043a\u0430\u043b\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ sudo apt install flex make gawk libgmp-dev libmpfr-dev libmpc-dev gcc-multilib<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c <code>rustc_codegen_gcc<\/code>, \u043f\u0430\u0442\u0447\u0435\u043d\u043d\u044b\u0439 <code>gcc<\/code> \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c <code>gcc<\/code> \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 <code>i386<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\"># \u0423 \u043c\u0435\u043d\u044f \u0432\u0435\u0440\u0441\u0438\u044f 1724042e228c3 \u043e\u0442 Wed Sep 14 09:22:50 2022 $ git clone https:\/\/github.com\/rust-lang\/rustc_codegen_gcc.git --depth 1 rustc_codegen_gcc$ cd rustc_codegen_gcc  #BUILD GCC (20 mins) rustc_codegen_gcc$ git clone https:\/\/github.com\/antoyo\/gcc.git --depth 1 rustc_codegen_gcc$ cd gcc rustc_codegen_gcc\/gcc$ mkdir build install rustc_codegen_gcc\/gcc$ cd build rustc_codegen_gcc\/gcc\/build$ ..\/configure --enable-host-shared --enable-languages=jit,c --disable-bootstrap --enable-multilib --target=x86_64-pc-linux-gnu --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64 --enable-multiarch --prefix=$(pwd)\/..\/install rustc_codegen_gcc\/gcc\/build$ make -j8 rustc_codegen_gcc\/gcc\/build$ make install # \u0432 \u043f\u0430\u043f\u043e\u0447\u043a\u0443 ..\/install rustc_codegen_gcc\/gcc\/build$ cd ..\/..\/ rustc_codegen_gcc$ echo $(pwd)\/gcc\/install\/lib\/ > gcc_path<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u0430\u0441\u0442\u0435\u0440 \u0432\u0435\u0442\u043a\u0430 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <code>i386<\/code> \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u043d\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0430\u0442\u0447 rustc_codegen_gcc, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b i386<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"diff\">diff --git a\/config.sh b\/config.sh index b25e215..18574f2 100644 --- a\/config.sh +++ b\/config.sh @@ -20,8 +20,9 @@ else  fi   HOST_TRIPLE=$(rustc -vV | grep host | cut -d: -f2 | tr -d \" \") -TARGET_TRIPLE=$HOST_TRIPLE +#TARGET_TRIPLE=$HOST_TRIPLE  #TARGET_TRIPLE=\"m68k-unknown-linux-gnu\" +TARGET_TRIPLE=\"i686-unknown-linux-gnu\"   linker=''  RUN_WRAPPER='' @@ -33,6 +34,8 @@ if [[ \"$HOST_TRIPLE\" != \"$TARGET_TRIPLE\" ]]; then        # We are cross-compiling for aarch64. Use the correct linker and run tests in qemu.        linker='-Clinker=aarch64-linux-gnu-gcc'        RUN_WRAPPER='qemu-aarch64 -L \/usr\/aarch64-linux-gnu' +   elif [[ \"$TARGET_TRIPLE\" == \"i686-unknown-linux-gnu\" ]]; then +      : # do nothing     else        echo \"Unknown non-native platform\"     fi diff --git a\/src\/back\/write.rs b\/src\/back\/write.rs index efcf18d..e640fbe 100644 --- a\/src\/back\/write.rs +++ b\/src\/back\/write.rs @@ -14,6 +14,8 @@ pub(crate) unsafe fn codegen(cgcx: &amp;CodegenContext&lt;GccCodegenBackend>, _diag_han      let _timer = cgcx.prof.generic_activity_with_arg(\"LLVM_module_codegen\", &amp;*module.name);      {          let context = &amp;module.module_llvm.context; +        context.add_command_line_option(\"-m32\"); +        context.add_driver_option(\"-m32\");           let module_name = module.name.clone();          let module_name = Some(&amp;module_name[..]); diff --git a\/src\/base.rs b\/src\/base.rs index 8cc9581..fb8bd88 100644 --- a\/src\/base.rs +++ b\/src\/base.rs @@ -98,7 +98,7 @@ pub fn compile_codegen_unit&lt;'tcx>(tcx: TyCtxt&lt;'tcx>, cgu_name: Symbol, supports_          context.add_command_line_option(\"-mpclmul\");          context.add_command_line_option(\"-mfma\");          context.add_command_line_option(\"-mfma4\"); -        context.add_command_line_option(\"-m64\"); +        context.add_command_line_option(\"-m32\");          context.add_command_line_option(\"-mbmi\");          context.add_command_line_option(\"-mgfni\");          context.add_command_line_option(\"-mavxvnni\"); diff --git a\/src\/context.rs b\/src\/context.rs index 2699559..056352a 100644 --- a\/src\/context.rs +++ b\/src\/context.rs @@ -161,13 +161,13 @@ impl&lt;'gcc, 'tcx> CodegenCx&lt;'gcc, 'tcx> {          let ulonglong_type = context.new_c_type(CType::ULongLong);          let sizet_type = context.new_c_type(CType::SizeT);  -        let isize_type = context.new_c_type(CType::LongLong); -        let usize_type = context.new_c_type(CType::ULongLong); +        let isize_type = context.new_c_type(CType::Int); +        let usize_type = context.new_c_type(CType::UInt);          let bool_type = context.new_type::&lt;bool>();           \/\/ TODO(antoyo): only have those assertions on x86_64. -        assert_eq!(isize_type.get_size(), i64_type.get_size()); -        assert_eq!(usize_type.get_size(), u64_type.get_size()); +        assert_eq!(isize_type.get_size(), i32_type.get_size()); +        assert_eq!(usize_type.get_size(), u32_type.get_size());           let mut functions = FxHashMap::default();          let builtins = [ diff --git a\/src\/int.rs b\/src\/int.rs index 0c5dab0..5fd4925 100644 --- a\/src\/int.rs +++ b\/src\/int.rs @@ -524,7 +524,7 @@ impl&lt;'a, 'gcc, 'tcx> Builder&lt;'a, 'gcc, 'tcx> {          \/\/ when having proper sized integer types.          let param_type = bswap.get_param(0).to_rvalue().get_type();          if param_type != arg_type { -            arg = self.bitcast(arg, param_type); +            arg = self.cx.context.new_cast(None, arg, param_type);          }          self.cx.context.new_call(None, bswap, &amp;[arg])      } diff --git a\/src\/lib.rs b\/src\/lib.rs index e43ee5c..8fb5823 100644 --- a\/src\/lib.rs +++ b\/src\/lib.rs @@ -104,6 +104,7 @@ impl CodegenBackend for GccCodegenBackend {          let temp_dir = TempDir::new().expect(\"cannot create temporary directory\");          let temp_file = temp_dir.into_path().join(\"result.asm\");          let check_context = Context::default(); +        check_context.add_command_line_option(\"-m32\");          check_context.set_print_errors_to_stderr(false);          let _int128_ty = check_context.new_c_type(CType::UInt128t);          \/\/ NOTE: we cannot just call compile() as this would require other files than libgccjit.so.<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0418 \u043f\u043e\u0432\u0435\u0440\u0445 \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u0442\u0447\u0430 \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d, \u0447\u0442\u043e\u0431\u044b <code>libgccjit.so<\/code> \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0444\u043b\u0430\u0433\u043e\u0432:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0430\u0442\u0447 rustc_codegen_gcc \u0434\u043b\u044f \u0443\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0444\u043b\u0430\u0433\u043e\u0432<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"diff\">diff --git a\/src\/base.rs b\/src\/base.rs index fb8bd88..d5268dc 100644 --- a\/src\/base.rs +++ b\/src\/base.rs @@ -87,29 +87,11 @@ pub fn compile_codegen_unit&lt;'tcx>(tcx: TyCtxt&lt;'tcx>, cgu_name: Symbol, supports_          \/\/ Instantiate monomorphizations without filling out definitions yet...          \/\/let llvm_module = ModuleLlvm::new(tcx, &amp;cgu_name.as_str());          let context = Context::default(); -        \/\/ TODO(antoyo): only set on x86 platforms.          context.add_command_line_option(\"-masm=intel\"); -        \/\/ TODO(antoyo): only add the following cli argument if the feature is supported. -        context.add_command_line_option(\"-msse2\"); -        context.add_command_line_option(\"-mavx2\"); -        \/\/ FIXME(antoyo): the following causes an illegal instruction on vmovdqu64 in std_example on my CPU. -        \/\/ Only add if the CPU supports it. -        context.add_command_line_option(\"-msha\"); -        context.add_command_line_option(\"-mpclmul\"); -        context.add_command_line_option(\"-mfma\"); -        context.add_command_line_option(\"-mfma4\");          context.add_command_line_option(\"-m32\"); -        context.add_command_line_option(\"-mbmi\"); -        context.add_command_line_option(\"-mgfni\"); -        context.add_command_line_option(\"-mavxvnni\"); -        context.add_command_line_option(\"-mf16c\"); -        context.add_command_line_option(\"-maes\"); -        context.add_command_line_option(\"-mxsavec\"); -        context.add_command_line_option(\"-mbmi2\"); -        context.add_command_line_option(\"-mrtm\"); -        context.add_command_line_option(\"-mvaes\"); -        context.add_command_line_option(\"-mvpclmulqdq\"); -        context.add_command_line_option(\"-mavx\"); +        context.add_command_line_option(\"-fno-pic\"); +        context.add_command_line_option(\"-fno-asynchronous-unwind-tables\"); +        context.add_command_line_option(\"-Os\");           for arg in &amp;tcx.sess.opts.cg.llvm_args {              context.add_command_line_option(arg);<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c <code>llvm<\/code> \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c <code>rustc_codegen_gcc<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">#BUILD RUSTC: (5 mins) rustc_codegen_gcc$ git clone https:\/\/github.com\/llvm\/llvm-project llvm --depth 1 --single-branch rustc_codegen_gcc$ export RUST_COMPILER_RT_ROOT=\"$PWD\/llvm\/compiler-rt\" rustc_codegen_gcc$ .\/prepare_build.sh # download and patch sysroot src rustc_codegen_gcc$ .\/build.sh<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0441\u0451, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0441\u0432\u043e\u0438\u043c\u0438 \u0440\u0443\u0447\u043a\u0430\u043c\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0421\u0438 (<code>~\/rustc_codegen_gcc\/gcc\/install\/bin\/gcc<\/code>), <code>libgccjit.so<\/code> \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0420\u0430\u0441\u0442\u0430 c \u0437\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u043b\u0430\u0433\u0430\u043c\u0438 <code>-Os -masm=intel -m32 -fno-pic -fno-asynchronous-unwind-tables<\/code> \u0438 \u0441\u043a\u0440\u0438\u043f\u0442 <code>~\/rustc_codegen_gcc\/cargo.sh<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0443 <code>rustc<\/code> \u0431\u0435\u043a\u0435\u043d\u0434 <code>gcc<\/code>.<\/p>\n<p>  <a name=\"para_14\"><\/a>  <\/p>\n<h2 id=\"hello-vorld-na-si-pod-i386\">\u0425\u044d\u043b\u043b\u043e \u0432\u043e\u0440\u043b\u0434 \u043d\u0430 \u0421\u0438 \u043f\u043e\u0434 i386<\/h2>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">int sys_write(int fd, const void *buf, int size); void sys_exit(int status); static int main(int argc, char **argv); static int syscall1(int n, int a1); static int syscall3(int n, int a1, int a2, int a3);  static const char hello[] = \"Hello, world!\\n\";  void _Noreturn __attribute__((naked)) _start() {   __asm volatile (     \"_start:\\n\"     \"  mov ecx, [esp]\\n\"     \"  mov eax, esp\\n\"     \"  add eax, 4\\n\"     \"  push eax\\n\"     \"  push ecx\\n\"     \"  call _start_main\\n\"   ); }  void _Noreturn _start_main(int argc, char **argv) {   int status = main(argc, argv);   sys_exit(status); }  static int main(int argc, char **argv) {   sys_write(1, hello, sizeof(hello)-1);   return 0; }  void _Noreturn __attribute__ ((noinline)) sys_exit(int status) {   syscall1(1, status);   __builtin_unreachable(); }  int __attribute__ ((noinline)) sys_write(int fd, const void *buf, int size) {   return syscall3(4, fd, (int) buf, size); }  static int syscall1(int n, int a1) {   int ret;   __asm volatile (     \"  int 0x80\"     : \"=a\" (ret)     : \"0\" (n), \"b\" (a1)     : \"memory\"   );   return ret; }  static int syscall3(int n, int a1, int a2, int a3) {   int ret;   __asm volatile (     \"  int 0x80\"     : \"=a\" (ret)     : \"0\" (n), \"b\" (a1), \"c\" (a2), \"d\" (a3)     : \"memory\"   );   return ret; }<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u0438\u0441\u0435\u0434\u0430\u043d\u0438\u044f \u0441 <code>_Noreturn<\/code>, <code>static<\/code>, <code>__attribute__((naked))<\/code> \u043f\u0440\u044f\u043c\u043e\u0435 \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0432 \u043a\u043e\u0434\u0435 \u043d\u0430 \u0420\u0430\u0441\u0442\u0435. \u0422.\u0435. \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443, \u0447\u0442\u043e \u0438\u0437 <code>sys_exit<\/code> \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u044b\u0439\u0442\u0438, <code>static<\/code> \u2014 \u0434\u043b\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0433\u043e \u0438\u043d\u043b\u0430\u0439\u043d\u0430 (\u0438 \u0447\u0442\u043e\u0431\u044b \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u043c \u0431\u0438\u043d\u0430\u0440\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b), \u0430 <code>__attribute__((naked))<\/code> \u2014 \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0432\u0441\u0442\u0430\u0432\u0438\u043b \u043f\u0440\u043e\u043b\u043e\u0433 \u0438 \u044d\u043f\u0438\u043b\u043e\u0433 \u0434\u043b\u044f <code>_start<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">~\/rustc_codegen_gcc\/gcc\/install\/bin\/gcc -Os -masm=intel -m32 -fno-pic -fno-asynchronous-unwind-tables -Wall -Wno-main -c hello_world.c ld.lld-14 --no-pie --no-dynamic-linker hello_world.o -o hello_world strip hello_world objcopy -j.text -j.rodata hello_world<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ .\/build.sh $ .\/hello_world  Hello, world!<\/code><\/pre>\n<p>  <a name=\"para_15\"><\/a>  <\/p>\n<h2 id=\"hello-vorld-na-raste-pod-i386\">\u0425\u044d\u043b\u043b\u043e \u0432\u043e\u0440\u043b\u0434 \u043d\u0430 \u0420\u0430\u0441\u0442\u0435 \u043f\u043e\u0434 i386<\/h2>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"rust\">#![feature(no_core)] #![feature(lang_items)] #![feature(naked_functions)] #![feature(decl_macro)] #![feature(rustc_attrs)] #![feature(intrinsics)] #![no_core] #![no_main]  #[lang = \"sized\"] pub trait Sized {}  #[lang = \"copy\"] pub trait Copy {}  impl Copy for i32 {} impl Copy for usize {}  #[rustc_builtin_macro] pub macro asm(\"assembly template\", $(operands,)* $(options($(option),*))?) {   \/* compiler built-in *\/ }  extern \"rust-intrinsic\" {   pub fn unreachable() -> !; }  #[no_mangle] #[naked] unsafe extern \"C\" fn _start() {   asm!(     \"mov ecx, [esp]\",     \"mov eax, esp\",     \"add eax, 4\",     \"push eax\",     \"push ecx\",     \"call _start_main\",     options(noreturn),   ) }  #[no_mangle] extern \"C\" fn _start_main(argc: usize, argv: *const *const u8) -> ! {   let status = main(argc, argv);   sys_exit(status); }  #[no_mangle] fn main(_argc: usize, _argv: *const *const u8) -> i32 {   let string = b\"Hello, world!\\n\" as *const _ as *const u8;   sys_write(1, string, 14);   return 0; }  #[inline(never)] #[no_mangle] fn sys_write(fd: i32, data: *const u8, len: i32) -> i32 {   unsafe { syscall3(4, fd, data as _, len) } }  #[inline(never)] #[no_mangle] fn sys_exit(status: i32) -> ! {   unsafe {     syscall1(1, status);     unreachable()   } }  #[inline(always)] unsafe extern \"C\" fn syscall1(n: i32, a1: i32) -> i32 {   let ret: i32;   asm!(     \"int 0x80\",     in(\"eax\") n,     in(\"ebx\") a1,     lateout(\"eax\") ret,   );   ret }  #[inline(always)] unsafe fn syscall3(n: i32, a1: i32, a2: i32, a3: i32) -> i32 {   let ret: i32;   asm!(     \"int 0x80\",     in(\"eax\") n,     in(\"ebx\") a1,     in(\"ecx\") a2,     in(\"edx\") a3,     lateout(\"eax\") ret,   );   ret }<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\"># cargo.sh, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 rustc_codegen_gcc, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f CG_RUSTFLAGS # \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 .cargo\/config \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c. \u0423\u0432\u044b.  export CG_RUSTFLAGS=\"-C linker=ld.lld-14 -C link-args=--no-pie -C link-args=--no-dynamic-linker\" ~\/rustc_codegen_gcc\/cargo.sh b --target i686-unknown-linux-gnu strip .\/target\/i686-unknown-linux-gnu\/debug\/hello_world objcopy -j.text -j.rodata .\/target\/i686-unknown-linux-gnu\/debug\/hello_world<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ .\/build.sh  rustc_codegen_gcc is build for rustc 1.65.0-nightly (748038961 2022-08-25) but the default rustc version is rustc 1.63.0-nightly (7466d5492 2022-06-08). Using rustc 1.65.0-nightly (748038961 2022-08-25).    Compiling hello_world v0.1.0 (\/home\/USER\/rustmustdie\/article\/chapter_6)     Finished dev [unoptimized + debuginfo] target(s) in 0.84s $ .\/target\/i686-unknown-linux-gnu\/debug\/hello_world  Hello, world!<\/code><\/pre>\n<p>  <a name=\"para_16\"><\/a>  <\/p>\n<h2 id=\"sravnenie\">\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<th>\u0421\u0438<\/th>\n<th>\u0420\u0430\u0441\u0442<\/th>\n<\/tr>\n<tr>\n<td>\n<pre> $ stat -c %s hello_world 496 $ size -A hello_world hello_world  : section   size      addr .rodata     15   4194516 .text       84   4198627 Total       99 <\/pre>\n<\/td>\n<td>\n<pre> $ stat -c %s .\/hello_world 464 $ size -A .\/hello_world .\/hello_world  : section   size      addr .rodata     14   4194484 .text       82   4198594 Total       96 <\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a, \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u0420\u0430\u0441\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f 464 \u0431\u0430\u0439\u0442\u0430, \u0430 \u043d\u0430 \u0421\u0438 \u2014 494 \u0431\u0430\u0439\u0442. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441, \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u043b\u0438 \u0420\u0430\u0441\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0439 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0442\u0430\u043a\u0436\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u043c zero runtime. <\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0445\u0441\u044f, \u0432\u043e\u0442 \u0432\u0441\u044f \u0438\u043d\u0444\u0430 \u043e \u0431\u0438\u043d\u0430\u0440\u044f\u0445:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u0438<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">$ objdump -Cd hello_world  hello_world:     file format elf32-i386  Disassembly of section .text:  004010e3 &lt;_start>:   4010e3:   8b 0c 24                mov    (%esp),%ecx   4010e6:   89 e0                   mov    %esp,%eax   4010e8:   83 c0 04                add    $0x4,%eax   4010eb:   50                      push   %eax   4010ec:   51                      push   %ecx   4010ed:   e8 27 00 00 00          call   401119 &lt;_start_main>   4010f2:   0f 0b                   ud2      004010f4 &lt;sys_exit>:   4010f4:   55                      push   %ebp   4010f5:   b8 01 00 00 00          mov    $0x1,%eax   4010fa:   89 e5                   mov    %esp,%ebp   4010fc:   53                      push   %ebx   4010fd:   8b 5d 08                mov    0x8(%ebp),%ebx   401100:   cd 80                   int    $0x80  00401102 &lt;sys_write>:   401102:   55                      push   %ebp   401103:   b8 04 00 00 00          mov    $0x4,%eax   401108:   89 e5                   mov    %esp,%ebp   40110a:   53                      push   %ebx   40110b:   8b 4d 0c                mov    0xc(%ebp),%ecx   40110e:   8b 55 10                mov    0x10(%ebp),%edx   401111:   8b 5d 08                mov    0x8(%ebp),%ebx   401114:   cd 80                   int    $0x80   401116:   5b                      pop    %ebx   401117:   5d                      pop    %ebp   401118:   c3                      ret      00401119 &lt;_start_main>:   401119:   55                      push   %ebp   40111a:   89 e5                   mov    %esp,%ebp   40111c:   83 ec 0c                sub    $0xc,%esp   40111f:   6a 0e                   push   $0xe   401121:   68 d4 00 40 00          push   $0x4000d4   401126:   6a 01                   push   $0x1   401128:   e8 d5 ff ff ff          call   401102 &lt;sys_write>   40112d:   31 c0                   xor    %eax,%eax   40112f:   89 04 24                mov    %eax,(%esp)   401132:   e8 bd ff ff ff          call   4010f4 &lt;sys_exit>  $ readelf -a hello_world ELF Header:   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00    Class:                             ELF32   Data:                              2s complement, little endian   Version:                           1 (current)   OS\/ABI:                            UNIX - System V   ABI Version:                       0   Type:                              EXEC (Executable file)   Machine:                           Intel 80386   Version:                           0x1   Entry point address:               0x4010e3   Start of program headers:          52 (bytes into file)   Start of section headers:          336 (bytes into file)   Flags:                             0x0   Size of this header:               52 (bytes)   Size of program headers:           32 (bytes)   Number of program headers:         4   Size of section headers:           40 (bytes)   Number of section headers:         4   Section header string table index: 3  Section Headers:   [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al   [ 0]                   NULL            00000000 000000 000000 00      0   0  0   [ 1] .rodata           PROGBITS        004000d4 0000d4 00000f 00   A  0   0  4   [ 2] .text             PROGBITS        004010e3 0000e3 000054 00  AX  0   0  1   [ 3] .shstrtab         STRTAB          00000000 000137 000019 00      0   0  1 Key to Flags:   W (write), A (alloc), X (execute), M (merge), S (strings), I (info),   L (link order), O (extra OS processing required), G (group), T (TLS),   C (compressed), x (unknown), o (OS specific), E (exclude),   p (processor specific)  There are no section groups in this file.  Program Headers:   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align   PHDR           0x000034 0x00400034 0x00400034 0x00080 0x00080 R   0x4   LOAD           0x000000 0x00400000 0x00400000 0x000e3 0x000e3 R   0x1000   LOAD           0x0000e3 0x004010e3 0x004010e3 0x00054 0x00054 R E 0x1000   GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0   Section to Segment mapping:   Segment Sections...    00         01     .rodata     02     .text     03       $ objdump -s .\/hello_world  .\/hello_world:     file format elf32-i386  Contents of section .rodata:  4000d4 48656c6c 6f2c2077 6f726c64 210a00    Hello, world!..  Contents of section .text:  4010e3 8b0c2489 e083c004 5051e827 0000000f  ..$.....PQ.''....  4010f3 0b55b801 00000089 e5538b5d 08cd8055  .U.......S.]...U  401103 b8040000 0089e553 8b4d0c8b 55108b5d  .......S.M..U..]  401113 08cd805b 5dc35589 e583ec0c 6a0e68d4  ...[].U.....j.h.  401123 0040006a 01e8d5ff ffff31c0 890424e8  .@.j......1...$.  401133 bdffffff                             ....                <\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0420\u0430\u0441\u0442<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">$ objdump -Cd .\/target\/i686-unknown-linux-gnu\/debug\/hello_world  .\/target\/i686-unknown-linux-gnu\/debug\/hello_world:     file format elf32-i386  Disassembly of section .text:  004010c2 &lt;_start>:   4010c2:   8b 0c 24                mov    (%esp),%ecx   4010c5:   89 e0                   mov    %esp,%eax   4010c7:   83 c0 04                add    $0x4,%eax   4010ca:   50                      push   %eax   4010cb:   51                      push   %ecx   4010cc:   e8 25 00 00 00          call   4010f6 &lt;_start_main>  004010d1 &lt;sys_write>:   4010d1:   55                      push   %ebp   4010d2:   b8 04 00 00 00          mov    $0x4,%eax   4010d7:   89 e5                   mov    %esp,%ebp   4010d9:   53                      push   %ebx   4010da:   8b 5d 08                mov    0x8(%ebp),%ebx   4010dd:   8b 4d 0c                mov    0xc(%ebp),%ecx   4010e0:   8b 55 10                mov    0x10(%ebp),%edx   4010e3:   cd 80                   int    $0x80   4010e5:   5b                      pop    %ebx   4010e6:   5d                      pop    %ebp   4010e7:   c3                      ret      004010e8 &lt;sys_exit>:   4010e8:   55                      push   %ebp   4010e9:   b8 01 00 00 00          mov    $0x1,%eax   4010ee:   89 e5                   mov    %esp,%ebp   4010f0:   53                      push   %ebx   4010f1:   8b 5d 08                mov    0x8(%ebp),%ebx   4010f4:   cd 80                   int    $0x80  004010f6 &lt;_start_main>:   4010f6:   55                      push   %ebp   4010f7:   89 e5                   mov    %esp,%ebp   4010f9:   83 ec 0c                sub    $0xc,%esp   4010fc:   6a 0e                   push   $0xe   4010fe:   68 b4 00 40 00          push   $0x4000b4   401103:   6a 01                   push   $0x1   401105:   e8 c7 ff ff ff          call   4010d1 &lt;sys_write>   40110a:   31 c0                   xor    %eax,%eax   40110c:   89 04 24                mov    %eax,(%esp)   40110f:   e8 d4 ff ff ff          call   4010e8 &lt;sys_exit>  $ readelf -a .\/target\/i686-unknown-linux-gnu\/debug\/hello_world ELF Header:   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00    Class:                             ELF32   Data:                              2s complement, little endian   Version:                           1 (current)   OS\/ABI:                            UNIX - System V   ABI Version:                       0   Type:                              EXEC (Executable file)   Machine:                           Intel 80386   Version:                           0x1   Entry point address:               0x4010c2   Start of program headers:          52 (bytes into file)   Start of section headers:          304 (bytes into file)   Flags:                             0x0   Size of this header:               52 (bytes)   Size of program headers:           32 (bytes)   Number of program headers:         4   Size of section headers:           40 (bytes)   Number of section headers:         4   Section header string table index: 3  Section Headers:   [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al   [ 0]                   NULL            00000000 000000 000000 00      0   0  0   [ 1] .rodata           PROGBITS        004000b4 0000b4 00000e 00   A  0   0  4   [ 2] .text             PROGBITS        004010c2 0000c2 000052 00  AX  0   0  1   [ 3] .shstrtab         STRTAB          00000000 000114 000019 00      0   0  1 Key to Flags:   W (write), A (alloc), X (execute), M (merge), S (strings), I (info),   L (link order), O (extra OS processing required), G (group), T (TLS),   C (compressed), x (unknown), o (OS specific), E (exclude),   p (processor specific)  There are no section groups in this file.  Program Headers:   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align   PHDR           0x000034 0x00400034 0x00400034 0x00080 0x00080 R   0x4   LOAD           0x000000 0x00400000 0x00400000 0x000c2 0x000c2 R   0x1000   LOAD           0x0000c2 0x004010c2 0x004010c2 0x00052 0x00052 R E 0x1000   GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0   Section to Segment mapping:   Segment Sections...    00         01     .rodata     02     .text     03       $ objdump -s .\/target\/i686-unknown-linux-gnu\/debug\/hello_world  .\/target\/i686-unknown-linux-gnu\/debug\/hello_world:     file format elf32-i386  Contents of section .rodata:  4000b4 48656c6c 6f2c2077 6f726c64 210a      Hello, world!.   Contents of section .text:  4010c2 8b0c2489 e083c004 5051e825 00000055  ..$.....PQ.%...U  4010d2 b8040000 0089e553 8b5d088b 4d0c8b55  .......S.]..M..U  4010e2 10cd805b 5dc355b8 01000000 89e5538b  ...[].U.......S.  4010f2 5d08cd80 5589e583 ec0c6a0e 68b40040  ]...U.....j.h..@  401102 006a01e8 c7ffffff 31c08904 24e8d4ff  .j......1...$...  401112 ffff                                 ..               <\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0421\u0438\u0448\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0442\u043e\u043b\u0449\u0435 \u043d\u0430 \u043e\u0434\u043d\u0443 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e <code>ud2<\/code> (\u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 2 \u0431\u0430\u0439\u0442\u0430) \u0438 \u043d\u0430 \u043e\u0434\u0438\u043d \u043d\u0443\u043b\u044c \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u043e\u043a\u0438. \u0412 <code>sys_exit<\/code> \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u0443\u0448\u0430\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0430 \u0432 \u0431\u0438\u043d\u0430\u0440\u044f\u0445 \u0432 \u0446\u0435\u043b\u043e\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c, \u0430 \u0442\u0430\u043a \u0431\u0438\u043d\u0430\u0440\u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0442\u0430\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0430\u0432\u0442\u043e\u0440\u0443 <code>rustc_codegen_gcc<\/code> \u2014 Antoyo. \u041e\u043d \u0432\u0435\u0434\u0435\u0442 <a href=\"https:\/\/blog.antoyo.xyz\/\" rel=\"nofollow noopener noreferrer\">\u0431\u043b\u043e\u0433<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0435\u043f\u043e\u0440\u0442\u0438\u0442 \u043e \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0418 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u041f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c, \u044f \u043f\u0440\u043e\u0448\u0443 \u0432\u0430\u0441 <a href=\"https:\/\/www.patreon.com\/antoyo\" rel=\"nofollow noopener noreferrer\">\u0437\u0430\u043f\u0430\u0442\u0440\u0435\u043e\u043d\u0438\u0442\u044c<\/a> Antoyo \u0438\u043b\u0438 <a href=\"https:\/\/github.com\/sponsors\/antoyo?o=esb\" rel=\"nofollow noopener noreferrer\">\u043f\u0440\u043e\u0441\u043f\u043e\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/a> \u0435\u0433\u043e \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435. \u041e\u043d \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0430\u0436\u043d\u043e\u0435 \u0434\u0435\u043b\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u044f\u0437\u044b\u043a\u0430 \u0420\u0430\u0441\u0442, \u043d\u043e \u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <code>gcc<\/code> (\u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 <code>libgccjit.so<\/code>), \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043e\u0442\u0432\u044f\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 <code>llvm<\/code> \u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u044f\u0434\u0440\u0430 \u041b\u0438\u043d\u0443\u043a\u0441\u0430 \u043f\u043e\u0434 \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 <code>gcc<\/code> \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b.<\/p>\n<p>  <a name=\"para_17\"><\/a>  <\/p>\n<h1 id=\"vyvody\">\u0412\u044b\u0432\u043e\u0434\u044b<\/h1>\n<p>  <\/p>\n<blockquote><p>\u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u2014 zero runtime \u2014 \u0434\u0435\u043b\u0430\u0435\u0442 \u0421\u0438 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438 \u0431\u0435\u0437\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u043e\u043c \u043d\u0430 \u0440\u043e\u043b\u044c \u044f\u0437\u044b\u043a\u0430 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0434\u0435\u0440 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043e\u043a \u0434\u043b\u044f \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432. \u0422\u0435\u043c \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u043b\u043e \u043b\u044e\u0434\u0435\u0439 \u0432 \u043c\u0438\u0440\u0435 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0441\u043e\u0437\u043d\u0430\u044e\u0442; \u0438 \u0441\u0442\u043e\u043a\u0440\u0430\u0442 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435 \u0442\u043e, \u0447\u0442\u043e \u043b\u044e\u0434\u0435\u0439, \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0445 \u044d\u0442\u043e, \u0441\u0443\u0434\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443, \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435\u0442 \u0441\u0440\u0435\u0434\u0438 \u0447\u043b\u0435\u043d\u043e\u0432 \u043a\u043e\u043c\u0438\u0442\u0435\u0442\u043e\u0432 \u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0430\u0446\u0438\u0438 (\u044f\u0437\u044b\u043a\u0430 \u0421\u0438)\u2026<\/p>\n<p>   \u2014 \u0410. \u0412. \u0421\u0442\u043e\u043b\u044f\u0440\u043e\u0432<\/p><\/blockquote>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0431\u0443\u0434\u0443 \u0437\u043d\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043c\u044b\u0441\u043b\u044c: \u0435\u0441\u043b\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u043e\u0440\u043e\u0442\u044c\u0441\u044f, \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a \u043d\u0430 \u0421\u0438. \u041d\u043e \u043d\u0430\u0434\u043e \u043b\u0438? \u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435. \u0410 \u0420\u0430\u0441\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0448\u0438\u0440\u043e\u0447\u0430\u0439\u0448\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u043a \u043f\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430, \u0442\u0430\u043a \u0438 \u043f\u043e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0448\u0438\u0431\u043e\u043a, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0445 \u0438\u0437-\u0437\u0430 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u044f \u044d\u0442\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0441 \u0434\u043e\u0446\u0435\u043d\u0442\u043e\u043c, \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u043c \u041c\u0413\u0423 \u0438 \u0441\u0442\u0430\u0442\u044c\u0451\u0439 <a href=\"https:\/\/rustmustdie.com\/\" rel=\"nofollow noopener noreferrer\">https:\/\/rustmustdie.com\/<\/a> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0433\u0434\u0435-\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0443\u0437\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u0435\u0448\u0430\u0435\u0442 \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u0430\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<p>\u042f \u0431\u044b \u0445\u043e\u0442\u0435\u043b, \u0447\u0442\u043e\u0431\u044b \u0432 \u041c\u0413\u0423 (\u0441\u0430\u043c\u043e\u043c \u041c\u0413\u0423!) \u0443\u0447\u0435\u043d\u044b\u0435 \u0438 \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u044b \u0431\u044b\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044b \u043a \u043f\u043e\u0437\u043d\u0430\u043d\u0438\u044e. \u0412\u0435\u0434\u044c \u0432 \u044d\u0442\u043e\u043c \u0438 \u0435\u0441\u0442\u044c \u0441\u0443\u0442\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u043e\u0432, \u043d\u0435\u0442? \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e\u0433\u043e \u0445\u043e\u0447\u0443?..<\/p>\n<p>  <a name=\"para_18\"><\/a>  <\/p>\n<h1 id=\"ssylki-na-kod\">\u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043a\u043e\u0434<\/h1>\n<p>  <\/p>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043a\u0430\u043a \u0438 \u043f\u0430\u0442\u0447\u0438, \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 <a href=\"https:\/\/github.com\/kpp\/minimal_hello_world_i386_rust_gcc\" rel=\"nofollow noopener noreferrer\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a> \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435, \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435. <\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u043e\u0437\u043d\u0438\u043a \u0432\u043e\u043f\u0440\u043e\u0441, \u0430 \u043a\u0430\u043a \u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u0435\u043b \u0432 \u0441\u0440\u0435\u0434\u0435 \u0431\u0435\u0437 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430, \u0432\u043e\u0442 <a href=\"https:\/\/github.com\/kpp\/toy_rt\" rel=\"nofollow noopener noreferrer\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a> \u043d\u0430 Linux x86_64 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0438, \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0438, \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432\u0440\u043e\u0434\u0435 \u0432\u0437\u044f\u0442\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0441\u043b\u0430\u0439\u0441\u0430, \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u043e\u043b\u0441\u0442\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0438 \u0442.\u0434., \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0447\u0435\u043c\u0443 \u0432 \u0445\u044d\u043b\u043b\u043e \u0432\u043e\u0440\u043b\u0434\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430 \u043d\u0435 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">#[no_mangle] fn main() {   print(\"Hello world!\\n\"); }  fn print(string: &amp;str) {   unsafe {     write(1, string.as_ptr(), string.len())   }; }<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/598219\/\"> https:\/\/habr.com\/ru\/post\/598219\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0435\u0440\u0438\u044f\u0445:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/338268\/\">Go \u0431\u044b\u0441\u0442\u0440\u0435\u0435 Rust, Mail.Ru Group \u0441\u0434\u0435\u043b\u0430\u043b\u0430 \u0437\u0430\u043c\u0435\u0440\u044b<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/492410\/\">C++ \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435 Rust, Yandex \u0441\u0434\u0435\u043b\u0430\u043b\u0430 \u0437\u0430\u043c\u0435\u0440\u044b<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u043d\u043e \u0432\u0435\u0440\u043d\u043e \u0420\u0430\u0441\u0442 \u043f\u0440\u043e\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0443\u043c\u044b \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0446\u0438\u0439, \u043d\u043e \u0438 \u0432 \u0443\u043c\u044b \u0448\u043a\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u0438 \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u043e\u0432. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0442 \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u0430 \u041c\u0413\u0423: <a href=\"https:\/\/rustmustdie.com\/\" rel=\"nofollow noopener noreferrer\">https:\/\/rustmustdie.com\/<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0415\u0451 <a href=\"http:\/\/stolyarov.info\/node\/342\" rel=\"nofollow noopener noreferrer\">\u0440\u0435\u043f\u043e\u0441\u0442\u043d\u0443\u043b<\/a> \u0410\u043d\u0434\u0440\u0435\u0439 \u0412\u0438\u043a\u0442\u043e\u0440\u043e\u0432\u0438\u0447 \u0421\u0442\u043e\u043b\u044f\u0440\u043e\u0432, \u0434\u043e\u0446\u0435\u043d\u0442 \u043a\u0430\u0444\u0435\u0434\u0440\u044b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u0444\u0430\u043a\u0443\u043b\u044c\u0442\u0435\u0442\u0430 \u0412\u041c\u041a \u041c\u0413\u0423 \u0438\u043c. \u041c. \u0412. \u041b\u043e\u043c\u043e\u043d\u043e\u0441\u043e\u0432\u0430 \u0438 \u043f\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0443 \u043d\u0430\u0443\u0447\u0440\u0443\u043a \u0441\u0442\u0443\u0434\u0435\u043d\u0442\u0430-\u0430\u0432\u0442\u043e\u0440\u0430 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  <\/p>\n<blockquote><p>\u042f \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0442\u0443\u0442 \u0434\u0435\u043b\u043e \u0434\u0430\u0436\u0435 \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d &#171;\u043d\u0435\u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u044b\u0439&#187;. \u0414\u0435\u043b\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0440\u0430\u0441\u0442\u0430 \u0441\u0430\u043c \u0440\u0435\u0448\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u043b\u0430\u0434\u0435\u043d\u0438\u0435 &#171;\u0434\u043e\u043b\u0436\u043d\u043e&#187; (\u0441 \u0435\u0433\u043e, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f) \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443. \u0410 \u0440\u0435\u0448\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u0430 \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440. \u041d\u0443 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043f\u043b\u044f\u0441\u043a\u0430 \u0432\u0438\u0434\u0430 &#171;\u043a\u0430\u043a \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0443\u043f\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u0439\u043b\u0435\u0440 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e, \u0447\u0435\u0433\u043e \u044f \u0445\u043e\u0447\u0443&#187;.<br \/>  \u0411\u0440\u0435\u0434 \u044d\u0442\u043e \u0432\u0441\u0451.<\/p>\n<p>   \u2014 \u0410. \u0412. \u0421\u0442\u043e\u043b\u044f\u0440\u043e\u0432<\/p><\/blockquote>\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-339145","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339145","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=339145"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/339145\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=339145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=339145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=339145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}