{"id":407330,"date":"2024-06-29T19:30:17","date_gmt":"2024-06-29T19:30:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=407330"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T19:30:17","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=407330","title":{"rendered":"<span>\u041e\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Clang \u0438 LLVM<\/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>\u041a\u0430\u0436\u0434\u044b\u0439, \u043a\u0442\u043e \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 C\/C++ \u0447\u0435\u0440\u0435\u0437 \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u0437\u043d\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u044b\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u0413\u043b\u0430\u0432\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c\u0438 \u0441\u0442\u043e\u043b\u044c \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0435\u0449\u0435\u0439 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u0434\u0440\u0443\u0436\u0435\u043b\u044e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430\u0431\u043e\u0440\u0430 \u0443\u0442\u0438\u043b\u0438\u0442 (\u0442\u0443\u043b\u0447\u0435\u0439\u043d\u0430).<\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0432\u0438\u043d\u043e\u0432\u043d\u0438\u043a\u043e\u0432 \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043e\u043f\u044b\u0442\u0443, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0443\u043b\u0447\u0435\u0439\u043d GNU \u2014 \u0434\u0440\u0435\u0432\u043d\u0438\u0439 \u043c\u0430\u043c\u043e\u043d\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u0439 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0432\u0435\u0441\u044c \u043c\u0438\u0440 POSIX. \u041f\u043e\u0434\u043e\u0431\u043d\u043e \u043c\u043d\u043e\u0433\u0438\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c \u0431\u044b\u043b\u044b\u0445 \u0432\u0440\u0435\u043c\u0451\u043d, \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e GCC \u0438 <code>binutils<\/code> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435, \u0438 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0445\u043e\u0442\u044c \u043a\u0430\u043a-\u0442\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0433\u043e \u0431\u044b\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u043b\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441-\u0431\u0438\u043b\u0434-\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0445\u043e\u0441\u0442\u0435.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0434\u043b\u044f FreeBSD \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435 \u043f\u043e\u0434 Linux \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GCC, \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 GCC + binutils \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b (\u0442.\u0435. <code>x86_64-pc-linux-gnu<\/code> \u0438\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435);<\/li>\n<li>\u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 GCC + binutils \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b (\u0442.\u0435. <code>x86_64-unknown-freebsd12.2-gcc<\/code>, <code>as<\/code>, <code>nm<\/code> \u0438 \u0442.\u0434.)<\/li>\n<li>Sysroot \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u043b\u0438\u0431\u043e \u0443\u0442\u0430\u0449\u0438\u0442\u044c \u0438\u0437 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0439 FreeBSD.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u044b Linux, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043d\u0430\u0431\u043e\u0440\u044b \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u0438\u0445 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u0432\u0432\u0438\u0434\u0443 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0439 \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0445\/\u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c. \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0443\u043b\u0447\u0435\u0439\u043d \u0441 \u043d\u0443\u043b\u044f, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043d\u044b\u043c \u0437\u0430\u0442\u0440\u0430\u0442\u0430\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0443 \u0432\u0430\u0441 \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u043c\u043e\u0449\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440.<\/p>\n<p>  <\/p>\n<h2 id=\"clang-kak-kross-kompilyator\">Clang \u043a\u0430\u043a \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440<\/h2>\n<p>  <\/p>\n<p>\u042d\u0442\u0438 \u0434\u043e\u0441\u0430\u0434\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0431\u0443\u0434\u0438\u043b\u0438 \u043c\u0435\u043d\u044f \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 LLVM (\u0438 Clang), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d \u043a\u0430\u043a \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0442\u0443\u043b\u0447\u0435\u0439\u043d \u0434\u043b\u044f \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 GNU. \u041e\u0434\u0438\u043d \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 LLVM \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 <em>\u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b<\/em>; \u043f\u043e\u043c\u0438\u043c\u043e \u043d\u0435\u0433\u043e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0443\u0436\u0435\u043d \u043b\u0438\u0448\u044c sysroot.<\/p>\n<p>  <\/p>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043e\u043d \u0435\u0449\u0451 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0443 \u0441 \u0442\u0443\u043b\u0447\u0435\u0439\u043d\u0430\u043c\u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 (\u0442\u0430\u043a\u0438\u043c\u0438, \u043a\u0430\u043a gc \u0438 <code>GOARCH<\/code>\/<code>GOOS<\/code> \u0432 Go), \u044d\u0442\u043e \u0432\u0441\u0451 \u0436\u0435 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0433\u043b\u043e\u0442\u043e\u043a \u0441\u0432\u0435\u0436\u0435\u0433\u043e \u0432\u043e\u0437\u0434\u0443\u0445\u0430 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0442\u0443\u043b\u0447\u0435\u0439\u043d\u043e\u0432 GNU. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430 (\u0435\u0441\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u0440\u044b\u0439), \u0438 \u0441\u0440\u0430\u0437\u0443 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u0441\u0435\u0445 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\u043c\u0438 GCC.<\/p>\n<p>  <\/p>\n<p>\u0415\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0435 \u0431\u044b\u043b \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 LLVM \u0435\u0449\u0451 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u043b \u0432 \u0441\u0435\u0431\u044f \u0432\u0435\u0441\u044c \u0442\u0443\u043b\u0447\u0435\u0439\u043d, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043e\u0442\u043a\u0443\u0434\u0430-\u0442\u043e \u0431\u0440\u0430\u0442\u044c <code>binutils<\/code>, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u0418 \u0434\u0430\u0436\u0435 \u0445\u043e\u0442\u044f \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0431\u044b\u043b\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0446\u0435\u043b\u0438\u043a\u043e\u043c (<code>binutils<\/code> \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435), \u044d\u0442\u043e\u0442 \u0444\u0430\u043a\u0442 \u0432\u0441\u0451 \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b \u0445\u043b\u043e\u043f\u043e\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u043a \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 <code>llvm-mc<\/code> (\u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440 LLVM) \u0438 <code>lld<\/code> (\u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u0438\u043d\u043a\u0435\u0440) \u0443\u0436\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b \u0438 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0436\u0435 \u0433\u0438\u0431\u043a\u0438, \u043a\u0430\u043a \u0432\u0435\u0441\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 LLVM.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u0435\u0441\u044c \u0442\u0443\u043b\u0447\u0435\u0439\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d, \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0435\u0449\u0451 sysroot, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b.<\/p>\n<p>  <\/p>\n<h2 id=\"dobyvaem-sysroot\">\u0414\u043e\u0431\u044b\u0432\u0430\u0435\u043c sysroot<\/h2>\n<p>  <\/p>\n<p>\u0411\u044b\u0441\u0442\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0440\u0430\u0437\u0434\u043e\u0431\u044b\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0434\u043b\u044f \u043d\u0443\u0436\u043d\u043e\u0439 \u041e\u0421 \u043c\u043e\u0436\u043d\u043e, \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0432 \u0435\u0451 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 Docker). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u0442\u0430\u043a \u044f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 sysroot \u0438\u0437 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0438 \u0441 FreeBSD 13-CURRENT AArch64 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>tar<\/code> \u0438 <code>ssh<\/code><\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ mkdir ~\/farm_tree $ ssh FARM64 'tar cf - \/lib \/usr\/include \/usr\/lib \/usr\/local\/lib \/usr\/local\/include' | bsdtar xvf - -C $HOME\/farm_tree\/<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u041f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e \u0441\u0435\u0442\u0438, \u0430 \u043d\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u0436\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f tarball<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"zapuskaem-kross-kompilyator\">\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440<\/h2>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e, \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Clang \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$  clang++ --target=aarch64-pc-freebsd --sysroot=$HOME\/farm_tree -fuse-ld=lld -stdlib=libc++ -o zpipe zpipe.cc -lz --verbose clang version 11.0.1 Target: aarch64-pc-freebsd Thread model: posix InstalledDir: \/usr\/bin  \"\/usr\/bin\/clang-11\" -cc1 -triple aarch64-pc-freebsd -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name zpipe.cc -mrelocation-model static -mframe-pointer=non-leaf -fno-rounding-math -mconstructor-aliases -munwind-tables -fno-use-init-array -target-cpu generic -target-feature +neon -target-abi aapcs -fallow-half-arguments-and-returns -fno-split-dwarf-inlining -debugger-tuning=gdb -v -resource-dir \/usr\/lib\/clang\/11.0.1 -isysroot \/home\/marco\/farm_tree -internal-isystem \/home\/marco\/farm_tree\/usr\/include\/c++\/v1 -fdeprecated-macro -fdebug-compilation-dir \/home\/marco\/dummies\/cxx -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -faddrsig -o \/tmp\/zpipe-54f1b1.o -x c++ zpipe.cc clang -cc1 version 11.0.1 based upon LLVM 11.0.1 default target x86_64-pc-linux-gnu #include \"...\" search starts here: #include &lt;...> search starts here:  \/home\/marco\/farm_tree\/usr\/include\/c++\/v1  \/usr\/lib\/clang\/11.0.1\/include  \/home\/marco\/farm_tree\/usr\/include End of search list.  \"\/usr\/bin\/ld.lld\" --sysroot=\/home\/marco\/farm_tree --eh-frame-hdr -dynamic-linker \/libexec\/ld-elf.so.1 --enable-new-dtags -o zpipe \/home\/marco\/farm_tree\/usr\/lib\/crt1.o \/home\/marco\/farm_tree\/usr\/lib\/crti.o \/home\/marco\/farm_tree\/usr\/lib\/crtbegin.o -L\/home\/marco\/farm_tree\/usr\/lib \/tmp\/zpipe-54f1b1.o -lz -lc++ -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed \/home\/marco\/farm_tree\/usr\/lib\/crtend.o \/home\/marco\/farm_tree\/usr\/lib\/crtn.o $ file zpipe zpipe: ELF 64-bit LSB executable, ARM aarch64, version 1 (FreeBSD), dynamically linked, interpreter \/libexec\/ld-elf.so.1, for FreeBSD 13.0 (1300136), FreeBSD-style, with debug_info, not stripped<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u0441\u043e\u0431\u0440\u0430\u043b \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a C++ \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b AArch64 FreeBSD, \u0438 \u0432\u0441\u0451 \u044d\u0442\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043b\u0438\u0448\u044c <code>clang<\/code> \u0438 <code>lld<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b \u043d\u0430 \u0441\u0432\u043e\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 GNU\/Linux.<\/p>\n<p>  <\/p>\n<p>\u0427\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u0435\u0439:<\/p>\n<p>  <\/p>\n<ol>\n<li><code>--target<\/code> \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 LLVM \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (<code>x86_64-pc-linux-gnu<\/code>) \u0432 <code>aarch64-pc-freebsd<\/code>, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e.<\/li>\n<li><code>--sysroot<\/code> \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Clang \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a\u0430\u043a \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439. \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 GCC, \u0430 Clang \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u043d\u0435\u043c\u0443. \u0422\u0430\u043a\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0435\u0433\u043a\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043a\u043b\u044e\u0447\u0430 <code>--gcc-toolchain<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0433\u0434\u0435 \u043d\u0430\u0439\u0442\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 GCC.<\/li>\n<li><code>-fuse-ld=lld<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 Clang \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>lld<\/code> \u0432\u043c\u0435\u0441\u0442\u043e \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c &#171;\u0447\u0443\u0436\u0443\u044e&#187; \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a LLD \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e <em>\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438<\/em> \u0432\u0441\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c.<\/li>\n<li><code>-stdlib=libc++<\/code> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 Clang \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0430\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0447\u0442\u043e FreeBSD \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 AArch64 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>libc++<\/code> \u0438\u0437 LLVM, \u0430 \u043d\u0435 <code>libstdc++<\/code> \u0438\u0437 GCC.<\/li>\n<li><code>-lz<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a Clang \u0443\u043c\u0435\u0435\u0442 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0432 sysroot \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>zlib<\/code>.<\/li>\n<\/ol>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0440\u043e Mac OS<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, macOS \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 LLD, \u0432\u0432\u0438\u0434\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 Mach-O \u0431\u044b\u043b\u0430 \u0437\u0430\u0431\u0440\u043e\u0448\u0435\u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434. \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0444\u043e\u0440\u043c\u0430\u0442\u0430 Mach-O \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u0438\u043d\u043a\u0435\u0440\u0430 <code>ld64<\/code> (\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e, \u0438\u043b\u0438 \u0432 \u043a\u0440\u043e\u0441\u0441-\u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u0430\u043c\u0438 \u0435\u0433\u043e \u0441\u043e\u0431\u0435\u0440\u0451\u0442\u0435). \u0425\u043e\u0442\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 <code>ld.bfd<\/code> \u0438\u0437 <code>binutils<\/code> \u0432\u0441\u0451 \u0435\u0449\u0451 \u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442.<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u043e\u0440\u0434\u0430, \u043c\u044b \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u043d\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u044c \u043d\u0430 \u043d\u0430\u0448\u0443 \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 (\u0442.\u0435. \u043d\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0443, \u043e\u0442\u043a\u0443\u0434\u0430 \u043c\u044b \u0438\u0437\u0432\u043b\u0435\u043a\u043b\u0438 \u0447\u0443\u0442\u044c \u0440\u0430\u043d\u044c\u0448\u0435 sysroot), \u0438 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ rsync zpipe FARM64:\"~\" $ ssh FARM64 FreeBSD-ARM64-VM $ chmod +x zpipe FreeBSD-ARM64-VM $ ldd zpipe zpipe:         libz.so.6 => \/lib\/libz.so.6 (0x4029e000)         libc++.so.1 => \/usr\/lib\/libc++.so.1 (0x402e4000)         libcxxrt.so.1 => \/lib\/libcxxrt.so.1 (0x403da000)         libm.so.5 => \/lib\/libm.so.5 (0x40426000)         libc.so.7 => \/lib\/libc.so.7 (0x40491000)         libgcc_s.so.1 => \/lib\/libgcc_s.so.1 (0x408aa000) FreeBSD-ARM64-VM $ .\/zpipe -h zpipe usage: zpipe [-d] &lt; source > dest<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0441\u0451 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c! \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u0440\u043e\u0441\u0441-\u0442\u0443\u043b\u0447\u0435\u0439\u043d \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u0438 \u043d\u0438\u0436\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<h3 id=\"opcionalno-sozdayom-papku-s-tulcheynom-llvm\">\u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e: \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u0430\u043f\u043a\u0443 \u0441 \u0442\u0443\u043b\u0447\u0435\u0439\u043d\u043e\u043c LLVM<\/h3>\n<p>  <\/p>\n<p>LLVM \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0443\u0442\u0438\u043b\u0438\u0442, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0432 <code>binutils<\/code> (\u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e <code>as<\/code>), \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c <code>llvm-<\/code> \u0432 \u0438\u043c\u0435\u043d\u0438.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0440\u043e \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p><code>llvm-mc<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a (\u043e\u0447\u0435\u043d\u044c \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0438\u0439) \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440, \u043d\u043e \u043e\u043d \u043f\u043b\u043e\u0445\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d. \u041f\u043e\u0434\u043e\u0431\u043d\u043e <code>gcc<\/code>, \u0444\u0440\u043e\u043d\u0442\u044d\u043d\u0434 <code>clang<\/code> \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440, \u0434\u0435\u043b\u0430\u044f <code>as<\/code> \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u043c.<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f LLD, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043a\u0430\u043a <code>ld.bfd<\/code> \u0438\u0437 GNU, \u0438\u043b\u0438 <code>gold<\/code> \u0438\u0437 GNU\/Linux \u0438\u043b\u0438 BSD, \u0442\u0430\u043a \u0438 <code>LINK.EXE<\/code> \u043e\u0442 Microsoft \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u043e\u0434 MSVC. \u041e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0443 \u043d\u0430 (\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438) \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0439 LLVM, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a\u0430\u0445.<\/p>\n<p>  <\/p>\n<p>\u041e\u0431\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, GCC \u0438 Clang \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>ld.lld<\/code> \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a\u0430 (\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 <code>lld<\/code>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 FreeBSD) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0430 <code>-fuse-ld=lld<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u043e\u043f\u044b\u0442\u0435 \u044f \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u0440\u0430\u0439\u0432\u0435\u0440 Clang \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0432\u0435\u0440\u043d\u044b\u0439 \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0434\u043a\u0438\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043e \u0432\u0435\u0440\u0441\u0438\u0438 11.0. \u041f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 <code>clang<\/code> \u043e\u0442\u043a\u0440\u044b\u0442\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043b\u044e\u0447 <code>-fuse-ld=lld<\/code> \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a (\u0432 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>ld.bfd<\/code>), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0434\u043b\u044f AArch64.<\/p>\n<p>  <\/p>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 \u0442\u0443\u043b\u0447\u0435\u0439\u043d\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0439 \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u044e\u0442 \u0443\u0442\u0438\u043b\u0438\u0442\u044b LLVM \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u0437 <code>binutils<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$  ls -la ~\/.llvm\/bin\/ Permissions Size User  Group Date Modified Name lrwxrwxrwx    16 marco marco  3 Aug  2020  ar -> \/usr\/bin\/llvm-ar lrwxrwxrwx    12 marco marco  6 Aug  2020  ld -> \/usr\/bin\/lld lrwxrwxrwx    21 marco marco  3 Aug  2020  objcopy -> \/usr\/bin\/llvm-objcopy lrwxrwxrwx    21 marco marco  3 Aug  2020  objdump -> \/usr\/bin\/llvm-objdump lrwxrwxrwx    20 marco marco  3 Aug  2020  ranlib -> \/usr\/bin\/llvm-ranlib lrwxrwxrwx    21 marco marco  3 Aug  2020  strings -> \/usr\/bin\/llvm-strings<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447 <code>-B<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Clang (\u0438\u043b\u0438 GCC) \u0438\u0441\u043a\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$  clang++ -B$HOME\/.llvm\/bin -stdlib=libc++ --target=aarch64-pc-freebsd --sysroot=$HOME\/farm_tree -std=c++17 -o mvd-farm64 mvd.cc $ file mvd-farm64 mvd-farm64: ELF 64-bit LSB executable, ARM aarch64, version 1 (FreeBSD), dynamically linked, interpreter \/libexec\/ld-elf.so.1, for FreeBSD 13.0, FreeBSD-style, with debug_info, not stripped<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"opcionalno-sozdayom-obyortki-clang-dlya-uproscheniya-kross-kompilyacii\">\u041e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e: \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u0451\u0440\u0442\u043a\u0438 Clang \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/h3>\n<p>  <\/p>\n<p>\u042f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0431\u043e\u0440\u043a\u0438 (\u0438 \u043f\u043e\u0434 <em>&#171;\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438&#187;<\/em> \u044f \u0438\u043c\u0435\u044e \u0432 \u0432\u0438\u0434\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0440\u0438\u0432\u044b\u0435 <code>Makefile<\/code>, \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 Autotools) \u0441\u043a\u043b\u043e\u043d\u043d\u044b \u043b\u043e\u043c\u0430\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f <code>$CC<\/code>, <code>$CXX<\/code> \u0438\u043b\u0438 <code>$LD<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0422\u0430\u043a\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043b\u0443\u0447\u0430\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <code>clang<\/code> \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 (\u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u0443\u0436\u0435 \u043e \u0442\u0435\u0445 \u043f\u0440\u0435\u0441\u0442\u0443\u043f\u043d\u0438\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0430\u0440\u0434\u043a\u043e\u0434\u044f\u0442 \u0432\u044b\u0437\u043e\u0432\u044b <code>gcc<\/code> \u0432 \u0441\u0432\u043e\u0438 \u0431\u0438\u043b\u0434-\u0441\u043a\u0440\u0438\u043f\u0442\u044b. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u044d\u0442\u043e \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f.)<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043d\u0438\u043c\u0430\u044f, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e \u0438 \u0441\u043b\u043e\u0436\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0432\u044b\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u044f \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0438\u0448\u0443 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u0434\u043b\u044f <code>clang<\/code> \u0438 <code>clang++<\/code> \u0441 \u0446\u0435\u043b\u044c\u044e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ cat ~\/.local\/bin\/aarch64-pc-freebsd-clang #!\/usr\/bin\/env sh  exec \/usr\/bin\/clang -B$HOME\/.llvm\/bin --target=aarch64-pc-freebsd --sysroot=$HOME\/farm_tree \"$@\" $ cat ~\/.local\/bin\/aarch64-pc-freebsd-clang++ #!\/usr\/bin\/env sh  exec \/usr\/bin\/clang++ -B$HOME\/.llvm\/bin -stdlib=libc++ --target=aarch64-pc-freebsd --sysroot=$HOME\/farm_tree \"$@\"   <\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432\u043d\u0443\u0442\u0440\u0438 $PATH, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ aarch64-pc-freebsd-clang++ -o tst tst.cc -static $ file tst tst: ELF 64-bit LSB executable, ARM aarch64, version 1 (FreeBSD), statically linked, for FreeBSD 13.0 (1300136), FreeBSD-style, with debug_info, not stripped<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"kross-sborka-s-pomoschyu-autotools-cmake-i-meson\">\u041a\u0440\u043e\u0441\u0441-\u0441\u0431\u043e\u0440\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Autotools, Cmake \u0438 Meson<\/h2>\n<p>  <\/p>\n<p>Autotools, Cmake \u0438 Meson, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0430\u043c\u044b\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043b\u044f open-source \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 C \u0438 C++ (\u0438\u0437\u0432\u0438\u043d\u0438, SCons). \u0412\u0441\u0435 \u0442\u0440\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u043f\u0440\u044f\u043c\u043e &#171;\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438&#187;, \u0445\u043e\u0442\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438. <\/p>\n<p>  <\/p>\n<h3 id=\"autotools\">Autotools<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u043d\u043e\u0433\u0438\u0445 \u043b\u0435\u0442 Autotools \u0441\u043b\u0430\u0432\u0438\u0442\u0441\u044f \u0441\u0432\u043e\u0435\u0439 \u0443\u0436\u0430\u0441\u043d\u043e\u0439 \u043d\u0435\u0443\u043a\u043b\u044e\u0436\u0435\u0441\u0442\u044c\u044e \u0438 \u0445\u0440\u0443\u043f\u043a\u043e\u0441\u0442\u044c\u044e. \u0418 \u0445\u043e\u0442\u044f \u044d\u0442\u0443 \u0440\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u044e \u043e\u043d \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0432\u043f\u043e\u043b\u043d\u0435 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043e, \u043e\u043d \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 GNU. \u0411\u0443\u0434\u0443\u0447\u0438 \u0432 \u0441\u0442\u0440\u043e\u044e \u0443\u0436\u0435 \u043d\u0435 \u043e\u0434\u043d\u043e \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u0435, \u043c\u043d\u043e\u0433\u0438\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0432\u0434\u0440\u0443\u0433 \u043f\u043e\u0448\u043b\u043e \u043a\u0440\u0438\u0432\u043e, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0432 \u0441\u0435\u0442\u0438 (\u0445\u043e\u0442\u044f \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u0441\u0432\u043e\u0439 <code>.ac<\/code> \u0444\u0430\u0439\u043b, \u044d\u0442\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0430\u043a). \u041f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438, \u0434\u043b\u044f \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0435\u043c\u0443 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0442\u0443\u043b\u0447\u0435\u0439\u043d\u0430 \u0438\u043b\u0438 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043e\u0441\u043e\u0431\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f; \u0432\u0441\u0451 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 <code>.\/configure<\/code> (\u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 autoconf, \u0438\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u0439 \u0432 \u0442\u0430\u0440\u0431\u043e\u043b\u043b \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438) <em>\u043e\u0431\u044b\u0447\u043d\u043e<\/em> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0444\u043b\u0430\u0433 <code>--host<\/code>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0437\u0430\u0434\u0430\u0442\u044c \u0442\u0440\u0438\u043f\u043b\u0435\u0442 <em>\u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/em>, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0444\u043b\u0430\u0433 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0443\u0442\u0438\u043b\u0438\u0442 <em>auto-\u0447\u0442\u043e-\u0442\u043e-\u0442\u0430\u043c<\/em> \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0432\u044b\u044f\u0441\u043d\u044f\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0437\u043e\u0432\u0451\u0442\u0441\u044f \u043f\u043e \u0438\u043c\u0435\u043d\u0430\u043c <code>some-triple-gcc<\/code> \u0438\u043b\u0438 <code>some-triple-g++<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 <code>binutils<\/code> \u0432\u0435\u0440\u0441\u0438\u0438 2.35.1 \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b <code>aarch-pc-freebsd<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432\u044b\u0448\u0435 \u043e\u0431\u0451\u0440\u0442\u043a\u0443 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 Clang:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ tar xvf binutils-2.35.1.tar.xz $ mkdir binutils-2.35.1\/build # always create a build directory to avoid messing up the source tree $ cd binutils-2.35.1\/build $ env CC='aarch64-pc-freebsd-clang' CXX='aarch64-pc-freebsd-clang++' AR=llvm-ar ..\/configure --build=x86_64-pc-linux-gnu --host=aarch64-pc-freebsd --enable-gold=yes checking build system type... x86_64-pc-linux-gnu checking host system type... aarch64-pc-freebsd checking target system type... aarch64-pc-freebsd checking for a BSD-compatible install... \/usr\/bin\/install -c checking whether ln works... yes checking whether ln -s works... yes checking for a sed that does not truncate output... \/usr\/bin\/sed checking for gawk... gawk checking for aarch64-pc-freebsd-gcc... aarch64-pc-freebsd-clang checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... yes checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether aarch64-pc-freebsd-clang accepts -g... yes checking for aarch64-pc-freebsd-clang option to accept ISO C89... none needed checking whether we are using the GNU C++ compiler... yes checking whether aarch64-pc-freebsd-clang++ accepts -g... yes [...]<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0437\u043e\u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <code>.\/configure<\/code> \u0432\u044b\u0448\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044f \u0445\u043e\u0447\u0443 \u043e\u0442 autotools \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0421\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 <code>x86_64-pc-linux-gnu<\/code> (\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0437\u0430\u0434\u0430\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0430 <code>--build<\/code>);<\/li>\n<li>\u0421\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 <code>aarch64-pc-freebsd<\/code>, \u0447\u0442\u043e \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u043e\u043c <code>--host<\/code>;<\/li>\n<li>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 C \u0438 C++ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0451\u0440\u0442\u043a\u0438 Clang, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435.<\/li>\n<li>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b <code>ar<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>llvm-ar<\/code>.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u042f \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0434\u0430\u043b \u0441\u0431\u043e\u0440\u043a\u0443 \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a\u0430 Gold, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u0421++ \u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0442\u0435\u0441\u0442 \u043d\u0430 \u0442\u043e, \u043a\u0430\u043a \u043d\u0430\u0448 \u0438\u043c\u043f\u0440\u043e\u0432\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0443\u043b\u0447\u0435\u0439\u043d \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 C++.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0442\u0430\u0434\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 (\u0432\u0440\u043e\u0434\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e), \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c GNU Make \u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c <code>binutils<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ make -j16 # because I have 16 threads on my system [ lots of output] $ mkdir dest $ make DESTDIR=$PWD\/dest install # install into a fake tree<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>make install<\/code>. \u0411\u044b\u0441\u0442\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>file<\/code> \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b <code>aarch64-pc-freebsd<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ file dest\/usr\/local\/bin\/ld.gold dest\/usr\/local\/bin\/ld.gold: ELF 64-bit LSB executable, ARM aarch64, version 1 (FreeBSD), dynamically linked, interpreter \/libexec\/ld-elf.so.1, for FreeBSD 13.0 (1300136), FreeBSD-style, with debug_info, not stripped<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"cmake\">CMake<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c CMake \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <em>\u0444\u0430\u0439\u043b\u0430 \u0442\u0443\u043b\u0447\u0435\u0439\u043d\u0430<\/em>. \u041e\u043d \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 CMake, \u043a\u0430\u043a \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0442\u0443\u043b\u0447\u0435\u0439\u043d\u043e\u043c, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044f \u0442\u0430\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u0430\u043a \u0446\u0435\u043b\u0435\u0432\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 CPU, \u0438\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 C++ \u0438 \u0442.\u0434.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0434 \u0442\u0440\u0438\u043f\u043b\u0435\u0442 <code>aarch64-pc-freebsd<\/code> \u0442\u0443\u043b\u0447\u0435\u0439\u043d \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cmake\">set(CMAKE_SYSTEM_NAME FreeBSD) set(CMAKE_SYSTEM_PROCESSOR aarch64)  set(CMAKE_SYSROOT $ENV{HOME}\/farm_tree)  set(CMAKE_C_COMPILER aarch64-pc-freebsd-clang) set(CMAKE_CXX_COMPILER aarch64-pc-freebsd-clang++) set(CMAKE_AR llvm-ar)  # these variables tell CMake to avoid using any binary it finds in  # the sysroot, while picking headers and libraries exclusively from it  set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u044f \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u043b \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0443\u044e \u043e\u0431\u0451\u0440\u0442\u043a\u0443 \u043a\u0430\u043a \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 C \u0438 C++ \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e Clang \u0441 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u044f\u043c\u043e\u043b\u0438\u043d\u0435\u0439\u043d\u043e \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u043e \u043e\u0448\u0438\u0431\u043a\u0430\u043c.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, <em>\u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e<\/em> \u0432\u0430\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <code>CMAKE_SYSROOT<\/code> \u0438 <code>CMAKE_FIND_ROOT_PATH_MODE_*<\/code>, \u0438\u043d\u0430\u0447\u0435 CMake \u043c\u043e\u0436\u0435\u0442 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u0441 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443, \u043f\u0440\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0431\u043e\u0440\u043a\u0438, \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>CMAKE_TOOLCHAIN_FILE<\/code>, \u043b\u0438\u0431\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>--toolchain<\/code>. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0441\u043e\u0431\u0435\u0440\u0443 \u043f\u0430\u043a\u0435\u0442 <code>{fmt}<\/code> (\u044d\u0442\u043e \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 C++, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0430\u043c \u043d\u0435\u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c) \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b <code>aarch64-pc-freebsd<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$  git clone https:\/\/github.com\/fmtlib\/fmt Cloning into 'fmt'... remote: Enumerating objects: 45, done. remote: Counting objects: 100% (45\/45), done. remote: Compressing objects: 100% (33\/33), done. remote: Total 24446 (delta 17), reused 12 (delta 7), pack-reused 24401 Receiving objects: 100% (24446\/24446), 12.08 MiB | 2.00 MiB\/s, done. Resolving deltas: 100% (16551\/16551), done. $ cd fmt $ cmake -B build -G Ninja -DCMAKE_TOOLCHAIN_FILE=$HOME\/toolchain-aarch64-freebsd.cmake -DBUILD_SHARED_LIBS=ON -DFMT_TEST=OFF . -- CMake version: 3.19.4 -- The CXX compiler identification is Clang 11.0.1 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: \/home\/marco\/.local\/bin\/aarch64-pc-freebsd-clang++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Version: 7.1.3 -- Build type: Release -- CXX_STANDARD: 11 -- Performing Test has_std_11_flag -- Performing Test has_std_11_flag - Success -- Performing Test has_std_0x_flag -- Performing Test has_std_0x_flag - Success -- Performing Test SUPPORTS_USER_DEFINED_LITERALS -- Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success -- Performing Test FMT_HAS_VARIANT -- Performing Test FMT_HAS_VARIANT - Success -- Required features: cxx_variadic_templates -- Performing Test HAS_NULLPTR_WARNING -- Performing Test HAS_NULLPTR_WARNING - Success -- Looking for strtod_l -- Looking for strtod_l - not found -- Configuring done -- Generating done -- Build files have been written to: \/home\/marco\/fmt\/build<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 Autotools, \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u0430\u044f \u0432 <code>cmake<\/code> \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0439. \u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442, \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <code>ninja<\/code> \u0438\u043b\u0438 <code>make<\/code>, \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ cmake --build build [4\/4] Creating library symlink libfmt.so.7 libfmt.so $ mkdir dest $ env DESTDIR=$PWD\/dest cmake --build build -- install [0\/1] Install the project... -- Install configuration: \"Release\" -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/lib\/libfmt.so.7.1.3 -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/lib\/libfmt.so.7 -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/lib\/libfmt.so -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/lib\/cmake\/fmt\/fmt-config.cmake -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/lib\/cmake\/fmt\/fmt-config-version.cmake -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/lib\/cmake\/fmt\/fmt-targets.cmake -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/lib\/cmake\/fmt\/fmt-targets-release.cmake -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/include\/fmt\/args.h -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/include\/fmt\/chrono.h -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/include\/fmt\/color.h -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/include\/fmt\/compile.h -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/include\/fmt\/core.h -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/include\/fmt\/format.h -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/include\/fmt\/format-inl.h -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/include\/fmt\/locale.h -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/include\/fmt\/os.h -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/include\/fmt\/ostream.h -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/include\/fmt\/posix.h -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/include\/fmt\/printf.h -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/include\/fmt\/ranges.h -- Installing: \/home\/marco\/fmt\/dest\/usr\/local\/lib\/pkgconfig\/fmt.pc $  file dest\/usr\/local\/lib\/libfmt.so.7.1.3 dest\/usr\/local\/lib\/libfmt.so.7.1.3: ELF 64-bit LSB shared object, ARM aarch64, version 1 (FreeBSD), dynamically linked, for FreeBSD 13.0 (1300136), with debug_info, not stripped<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"meson\">Meson<\/h3>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u043e CMake, Meson \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0444\u0430\u0439\u043b\u044b \u0442\u0443\u043b\u0447\u0435\u0439\u043d\u043e\u0432 (\u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 <em>&#171;cross files&#187;<\/em>), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442, \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0434 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u043d\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0430 TOML-\u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435, \u043e\u043d\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ cat meson_aarch64_fbsd_cross.txt [binaries] c = '\/home\/marco\/.local\/bin\/aarch64-pc-freebsd-clang' cpp = '\/home\/marco\/.local\/bin\/aarch64-pc-freebsd-clang++' ld = '\/usr\/bin\/ld.lld' ar = '\/usr\/bin\/llvm-ar' objcopy = '\/usr\/bin\/llvm-objcopy' strip = '\/usr\/bin\/llvm-strip'  [properties] ld_args = ['--sysroot=\/home\/marco\/farm_tree']  [host_machine] system = 'freebsd' cpu_family = 'aarch64' cpu = 'aarch64' endian = 'little'<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u043a\u0440\u043e\u0441\u0441-\u0444\u0430\u0439\u043b \u0434\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>meson setup<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u044e\u0447\u0430 <code>--cross-file<\/code>. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0436\u0435, \u043a\u0430\u043a \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Meson.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u0441\u0442\u0430\u0442\u0438&#8230;<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0442\u0443\u043b\u0447\u0435\u0439\u043d \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u043a\u043b\u044e\u0447\u043e\u043c <code>--native-file<\/code>. <\/p>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0418 \u043d\u0430 \u044d\u0442\u043e\u043c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0432\u0441\u0451: \u043f\u043e\u0434\u043e\u0431\u043d\u043e CMake \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0435\u0437\u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u0435\u043d \u0438 \u0431\u0435\u0437\u043e\u0448\u0438\u0431\u043e\u0447\u0435\u043d. \u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c <code>dav1d<\/code>, \u0434\u0435\u043a\u043e\u0434\u0435\u0440 VideoLAN AV1, \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b <code>aarch64-pc-freebsd<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ git clone https:\/\/code.videolan.org\/videolan\/dav1d Cloning into 'dav1d'... warning: redirecting to https:\/\/code.videolan.org\/videolan\/dav1d.git\/ remote: Enumerating objects: 164, done. remote: Counting objects: 100% (164\/164), done. remote: Compressing objects: 100% (91\/91), done. remote: Total 9377 (delta 97), reused 118 (delta 71), pack-reused 9213 Receiving objects: 100% (9377\/9377), 3.42 MiB | 54.00 KiB\/s, done. Resolving deltas: 100% (7068\/7068), done. $ meson setup build --cross-file ..\/meson_aarch64_fbsd_cross.txt --buildtype release The Meson build system Version: 0.56.2 Source dir: \/home\/marco\/dav1d Build dir: \/home\/marco\/dav1d\/build Build type: cross build Project name: dav1d Project version: 0.8.1 C compiler for the host machine: \/home\/marco\/.local\/bin\/aarch64-pc-freebsd-clang (clang 11.0.1 \"clang version 11.0.1\") C linker for the host machine: \/home\/marco\/.local\/bin\/aarch64-pc-freebsd-clang ld.lld 11.0.1 [ output cut ] $ meson compile -C build Found runner: ['\/usr\/bin\/ninja'] ninja: Entering directory `build' [129\/129] Linking target tests\/seek_stress $ mkdir dest $ env DESTDIR=$PWD\/dest meson install -C build ninja: Entering directory `build' [1\/11] Generating vcs_version.h with a custom command Installing src\/libdav1d.so.5.0.1 to \/home\/marco\/dav1d\/dest\/usr\/local\/lib Installing tools\/dav1d to \/home\/marco\/dav1d\/dest\/usr\/local\/bin Installing \/home\/marco\/dav1d\/include\/dav1d\/common.h to \/home\/marco\/dav1d\/dest\/usr\/local\/include\/dav1d Installing \/home\/marco\/dav1d\/include\/dav1d\/data.h to \/home\/marco\/dav1d\/dest\/usr\/local\/include\/dav1d Installing \/home\/marco\/dav1d\/include\/dav1d\/dav1d.h to \/home\/marco\/dav1d\/dest\/usr\/local\/include\/dav1d Installing \/home\/marco\/dav1d\/include\/dav1d\/headers.h to \/home\/marco\/dav1d\/dest\/usr\/local\/include\/dav1d Installing \/home\/marco\/dav1d\/include\/dav1d\/picture.h to \/home\/marco\/dav1d\/dest\/usr\/local\/include\/dav1d Installing \/home\/marco\/dav1d\/build\/include\/dav1d\/version.h to \/home\/marco\/dav1d\/dest\/usr\/local\/include\/dav1d Installing \/home\/marco\/dav1d\/build\/meson-private\/dav1d.pc to \/home\/marco\/dav1d\/dest\/usr\/local\/lib\/pkgconfig $ file dest\/usr\/local\/bin\/dav1d dest\/usr\/local\/bin\/dav1d: ELF 64-bit LSB executable, ARM aarch64, version 1 (FreeBSD), dynamically linked, interpreter \/libexec\/ld-elf.so.1, for FreeBSD 13.0 (1300136), FreeBSD-style, with debug_info, not stripped<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"bonus-staticheskaya-sborka-s-musl-i-alpine-linux\">\u0411\u043e\u043d\u0443\u0441: \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u0441 musl \u0438 Alpine Linux<\/h2>\n<p>  <\/p>\n<p>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430 C \u0438 C++ \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u043f\u0430\u0441\u0442\u0438 \u0432\u0430\u0441 \u043e\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043d\u0430 \u0442\u043e\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u0441\u0431\u043e\u0440\u043a\u0443. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0431\u043e\u0440\u043a\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u043e\u0432 \u043d\u0430 GNU\/Linux \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u0430, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 Glibc \u0432\u0441\u044f\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0435\u043f\u044f\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u043c \u0441\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0438\u043c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0447\u0435\u043c\u0443?<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438\u043c\u0451\u043d (NSS), \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0432 glibc, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u0447\u0438\u043d \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 dlopen()\/dlsym(). \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432, \u0432\u0440\u043e\u0434\u0435 mDNS, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438\u043c\u0451\u043d.<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<p>Musl \u2014 \u044d\u0442\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u043d\u0438\u0432\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f Linux, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0442\u0435\u0440\u043f\u0438\u043c\u0435\u0435 \u043a \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0435, \u0438 \u043d\u044b\u043d\u0447\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432. \u042d\u0442\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430 \u0432\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0447\u0438\u0441\u0442\u043e\u0433\u043e C.<\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c C++, \u043b\u0438\u0431\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435. \u041b\u044e\u0431\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0432\u0445\u043e\u0434\u044f\u0449\u0430\u044f \u0432 GNU\/Linux (\u0442\u0430\u043a\u0430\u044f, \u043a\u0430\u043a <code>libstdc++<\/code>, <code>libz<\/code>, <code>libffi<\/code> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435) \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 Glibc, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043b\u044e\u0431\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0434\u043b\u044f \u0446\u0435\u043b\u0438 Musl. \u042d\u0442\u043e \u0442\u0430\u043a \u0438 \u0434\u043b\u044f <code>libstdc++<\/code>, \u0447\u0442\u043e \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043b\u0438\u0431\u043e \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e GCC, \u043b\u0438\u0431\u043e \u0441\u0431\u043e\u0440\u043a\u0443 \u043a\u043e\u043f\u0438\u0438 <code>libc++<\/code> \u043e\u0442 LLVM.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b <em>&#171;Musl-plus-Linux&#187;<\/em>, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 Alpine Linux. \u0410 \u043f\u043e\u0442\u043e\u043c\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0441\u0432\u043e\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 \u043f\u043e\u0434\u0445\u043e\u0434: \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c sysroot \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b <code>x86_64-pc-linux-musl<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f Musl, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 Clang \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 100% \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c.<\/p>\n<p>  <\/p>\n<h3 id=\"nastroyka-konteynera-s-alpine\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 Alpine<\/h3>\n<p>  <\/p>\n<p>\u0425\u043e\u0440\u043e\u0448\u0435\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u0440\u0431\u043e\u043b\u043b \u0441 minirootfs \u043e\u0442 Alpine, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ wget -qO - https:\/\/dl-cdn.alpinelinux.org\/alpine\/v3.13\/releases\/x86_64\/alpine-minirootfs-3.13.1-x86_64.tar.gz | gunzip | sudo tar xfp - -C ~\/alpine_tree<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c chroot \u0432\u043d\u0443\u0442\u0440\u044c \u043e\u0431\u0440\u0430\u0437\u0430 <code>~\/alpine_tree<\/code> \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0435\u0433\u043e, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u043f\u0430\u043a\u0435\u0442\u044b. \u041e\u0431\u044b\u0447\u043d\u043e \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>systemd-nspawn<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>chroot<\/code>, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0449\u0435 \u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u043a\u043b\u043e\u043d\u044f\u0435\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0410 \u0435\u0449\u0451<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p><code>system-nspawn<\/code> \u043c\u043e\u0436\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0443\u0436\u0438\u0442\u044c \u043b\u0451\u0433\u043a\u043e\u0439 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0430\u0448\u0438\u043d\u0430\u043c. \u0421 \u043a\u043b\u044e\u0447\u043e\u043c <code>--boot<\/code> \u043e\u043d \u0443\u043c\u0435\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 init \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u0412\u043e\u0442 \u0432 \u044d\u0442\u043e\u043c <a href=\"https:\/\/gist.github.com\/sfan5\/52aa53f5dca06ac3af30455b203d3404\" rel=\"nofollow noopener noreferrer\">\u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u043c gist<\/a> \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 OpenRC (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Alpine)<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<pre><code class=\"bash\">$ sudo systemd-nspawn -D alpine_tree Spawning container alpinetree on \/home\/marco\/alpine_tree. Press ^] three times within 1s to kill container. alpinetree:~# <\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c (\u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e) \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>\/etc\/apk\/repositories<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0431\u0440\u0430\u043d\u0447 <code>edge<\/code> \u0441 \u0441\u0430\u043c\u044b\u043c\u0438 \u0441\u0432\u0435\u0436\u0438\u043c\u0438 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b Alpine, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043b\u044e\u0431\u044b\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">alpinetree:~# cat \/etc\/apk\/repositories https:\/\/dl-cdn.alpinelinux.org\/alpine\/edge\/main https:\/\/dl-cdn.alpinelinux.org\/alpine\/edge\/community alpinetree:~# apk update fetch https:\/\/dl-cdn.alpinelinux.org\/alpine\/edge\/main\/x86_64\/APKINDEX.tar.gz fetch https:\/\/dl-cdn.alpinelinux.org\/alpine\/edge\/community\/x86_64\/APKINDEX.tar.gz v3.13.0-1030-gbabf0a1684 [https:\/\/dl-cdn.alpinelinux.org\/alpine\/edge\/main] v3.13.0-1035-ga3ac7373fd [https:\/\/dl-cdn.alpinelinux.org\/alpine\/edge\/community] OK: 14029 distinct packages available alpinetree:~# apk upgrade OK: 6 MiB in 14 packages alpinetree:~# apk add g++ libc-dev (1\/14) Installing libgcc (10.2.1_pre1-r3) (2\/14) Installing libstdc++ (10.2.1_pre1-r3) (3\/14) Installing binutils (2.35.1-r1) (4\/14) Installing libgomp (10.2.1_pre1-r3) (5\/14) Installing libatomic (10.2.1_pre1-r3) (6\/14) Installing libgphobos (10.2.1_pre1-r3) (7\/14) Installing gmp (6.2.1-r0) (8\/14) Installing isl22 (0.22-r0) (9\/14) Installing mpfr4 (4.1.0-r0) (10\/14) Installing mpc1 (1.2.1-r0) (11\/14) Installing gcc (10.2.1_pre1-r3) (12\/14) Installing musl-dev (1.2.2-r1) (13\/14) Installing libc-dev (0.7.2-r3) (14\/14) Installing g++ (10.2.1_pre1-r3) Executing busybox-1.33.0-r1.trigger OK: 188 MiB in 28 packages alpinetree:~# apk add zlib-dev zlib-static (1\/3) Installing pkgconf (1.7.3-r0) (2\/3) Installing zlib-dev (1.2.11-r3) (3\/3) Installing zlib-static (1.2.11-r3) Executing busybox-1.33.0-r1.trigger OK: 189 MiB in 31 packages<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b <code>g++<\/code> \u0438 <code>libc-dev<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043f\u0438\u0438 <code>libstdc++<\/code>, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e <code>libc.a<\/code> (Musl), \u0438 \u0438\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u042f \u0442\u0430\u043a\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b <code>zlib-dev<\/code> \u0438 <code>zlib-static<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 zlib \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>zlib.a<\/code>. \u041a\u0430\u043a \u043e\u0431\u0449\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u2014 Alpine \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 <code>*-static<\/code>, \u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 <code>somepackage-dev<\/code>.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041d\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043f\u043e \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u043c\u043d\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c Alpine \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>libfmt<\/code>). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u043a\u043e\u043f\u0438\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439 \u0434\u043b\u044f C++, \u0438 \u043f\u043e\u0442\u043e\u043c\u0443 \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e.<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c <code>apk upgrade<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 <em>sysroot<\/em>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e Alpine \u0432 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.<\/p>\n<p>  <\/p>\n<h3 id=\"sborka-staticheskih-programm-na-c\">\u0421\u0431\u043e\u0440\u043a\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430 C++<\/h3>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e, \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0432\u044b\u0437\u0432\u0430\u0442\u044c <code>clang++<\/code>\u0441 \u0432\u0435\u0440\u043d\u044b\u043c <code>--target<\/code> \u0438 <code>--sysroot<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ clang++ -B$HOME\/.llvm\/bin --gcc-toolchain=$HOME\/alpine_tree\/usr --target=x86_64-alpine-linux-musl --sysroot=$HOME\/alpine_tree -L$HOME\/alpine_tree\/lib -std=c++17 -o zpipe zpipe.cc -lz -static $ file zpipe zpipe: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, with debug_info, not stripped<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 <code>--gcc-toolchain<\/code> \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u0435\u043d. \u041e\u043d \u043f\u043e\u043c\u043e\u0436\u0435\u0442, \u0435\u0441\u043b\u0438 Clang \u043d\u0435 \u043d\u0430\u0439\u0434\u0451\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 sysroot GCC \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b crt*.o. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 <code>-L<\/code> \u0434\u043b\u044f <code>\/lib<\/code> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 Alpine \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043b\u0435\u0436\u0430\u0442 \u043a\u0430\u043a \u0432 <code>\/usr\/lib<\/code>, \u0442\u0430\u043a \u0438 \u0432 <code>\/lib<\/code>, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 <code>clang<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0436\u0438\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 <code>$SYSROOT\/usr\/lib<\/code>.<\/p>\n<p>  <\/p>\n<h3 id=\"napisanie-obyortki-dlya-staticheskoy-linkovki-s-musl-i-clang\">\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438 \u0441 Musl \u0438 Clang<\/h3>\n<p>  <\/p>\n<p>\u0412 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 Musl \u043e\u0431\u044b\u0447\u043d\u043e \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 <code>musl-gcc<\/code> \u0438 <code>musl-clang<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438 \u0441 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c libc. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u044f \u043f\u043e-\u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443 \u043d\u0430\u0431\u0440\u043e\u0441\u0430\u043b \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Perl:<\/p>\n<p>  <\/p>\n<pre><code class=\"perl\">#!\/usr\/bin\/env perl  use strict; use utf8; use warnings; use v5.30;  use List::Util 'any';  my $ALPINE_DIR = $ENV{ALPINE_DIR} \/\/ \"$ENV{HOME}\/alpine_tree\"; my $TOOLS_DIR = $ENV{TOOLS_DIR} \/\/ \"$ENV{HOME}\/.llvm\/bin\";  my $CMD_NAME = $0 =~ \/\\+\\+\/ ? 'clang++' : 'clang'; my $STATIC = $0 =~ \/static\/;  sub clang {     exec $CMD_NAME, @_ or return 0; }  sub main {     my $compile = any { \/^\\s*-c|-S\\s*$\/ } @ARGV;      my @args = (          qq{-B$TOOLS_DIR},          qq{--gcc-toolchain=$ALPINE_DIR\/usr},          '--target=x86_64-alpine-linux-musl',          qq{--sysroot=$ALPINE_DIR},          qq{-L$ALPINE_DIR\/lib},          @ARGV,     );      unshift @args, '-static' if $STATIC and not $compile;      exit 1 unless clang @args; }  main;<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 &#171;\u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439&#187; \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043e\u0431\u0451\u0440\u0442\u043a\u0438, \u0447\u0435\u043c \u0442\u043e\u0442, \u0447\u0442\u043e \u044f \u043f\u0440\u0438\u0432\u0451\u043b \u0432\u044b\u0448\u0435 \u0434\u043b\u044f FreeBSD AArch64. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u043d\u0430 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u043a\u043e\u0434\u0430 \u043d\u0430 \u0421++, \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 <code>clang++<\/code>, \u0438\u043b\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043b\u044e\u0447 <code>-static<\/code>, \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u043f\u043e <em>\u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/em>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0439 \u0432 \u0438\u043c\u0435\u043d\u0438 \u0441\u043b\u043e\u0432\u043e <code>static<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ ls -la $(which musl-clang++) lrwxrwxrwx    10 marco marco 26 Jan 21:49  \/home\/marco\/.local\/bin\/musl-clang++ -> musl-clang $ ls -la $(which musl-clang++-static) lrwxrwxrwx    10 marco marco 26 Jan 22:03  \/home\/marco\/.local\/bin\/musl-clang++-static -> musl-clang $ musl-clang++-static -std=c++17 -o zpipe zpipe.cc -lz # automatically infers C++ and -static $ file zpipe zpipe: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, with debug_info, not stripped<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c Clang \u043b\u0438\u043d\u043a\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043a\u043b\u044e\u0447\u043e\u043c <code>-static<\/code>, \u0435\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c $CC \u0432 <code>musl-clang-static<\/code>, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u043e\u0439. \u041f\u043e \u043e\u043f\u044b\u0442\u0443 \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u044d\u0442\u0438\u043c \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 Autotools (\u0438\u043d\u043e\u0433\u0434\u0430), \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u0440\u0438\u0432\u044b\u0435 Makefiles.<\/p>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u041a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 C \u0438 C++ \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0438 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d\u0430 \u0441\u0442\u0430\u043b\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0449\u0435, \u043f\u043e\u043a\u0443\u0434\u0430 LLVM \u0434\u043e\u0441\u0442\u0438\u0433 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0441\u0442\u0430\u043b \u0448\u0438\u0440\u043e\u043a\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>-target<\/code> \u0432 Clang \u0438\u0437\u0431\u0430\u0432\u0438\u043b \u043c\u0435\u043d\u044f \u043e\u0442 \u0442\u0440\u0430\u0442\u044b \u0431\u0435\u0441\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e-\u0447\u0430\u0441\u043e\u0432 \u043d\u0430 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0443 GCC \u0438 Binutils.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435 \u0432\u0441\u0451 \u0442\u043e \u0437\u043e\u043b\u043e\u0442\u043e, \u0447\u0442\u043e \u0431\u043b\u0435\u0441\u0442\u0438\u0442, \u0438 \u0442\u0430\u043a \u0431\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e. \u0414\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u0441\u0442\u044b\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GCC \u0438\u0437-\u0437\u0430 \u0433\u0440\u044f\u0437\u043d\u044b\u0445 GNU\u0438\u0437\u043c\u043e\u0432 (\u0434\u0430-\u0434\u0430, Glibc, \u044d\u0442\u043e \u043f\u0440\u043e \u0442\u0435\u0431\u044f). \u041a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u043e\u0434 Windows\/MSVC \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0432\u0432\u0438\u0434\u0443 \u0441\u0438\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435\u0433\u043e \u0442\u0443\u043b\u0447\u0435\u0439\u043d\u0430 Visual Studio.<\/p>\n<p>  <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0445\u043e\u0442\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u0434 \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u043f\u0443\u0442\u0451\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0432 Clang \u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0442\u0440\u0438\u043f\u043b\u0435\u0442\u0430 \u0441\u0442\u0430\u043b\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u0431\u044b\u043b\u0430, \u043e\u043d\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0435\u0440\u0432\u043d\u043e \u043a\u0443\u0440\u0438\u0442, \u043f\u043e\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u044f \u043d\u0430 \u0442\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430 \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Rust \u0438\u043b\u0438 Go.<\/p>\n<p>  <\/p>\n<p>\u0418\u0437 \u043d\u043e\u0432\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 Zig, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0435\u0433\u043e \u0446\u0435\u043b\u044c\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 C \u0438 C++ \u043f\u043e\u0434 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u044b <code>zig cc<\/code> \u0438 <code>zig c++<\/code> \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0441\u0442\u0430\u0442\u044c \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0448\u0432\u0435\u0439\u0446\u0430\u0440\u0441\u043a\u0438\u043c \u043d\u043e\u0436\u043e\u043c \u0434\u043b\u044f \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u043c\u0443, \u0447\u0442\u043e Zig \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 <code>clang<\/code> \u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0447\u0430\u0441\u0442\u0435\u0439 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a Glibc, Musl, libc++ \u0438 MinGW. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043b\u044e\u0431\u0430\u044f \u043d\u0443\u0436\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043d\u0430\u0434\u043e, \u043f\u0440\u044f\u043c\u043e <em>\u043d\u0430 \u043b\u0435\u0442\u0443<\/em>:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ zig c++ --target=x86_64-windows-gnu -o str.exe str.cc $ file str.exe str.exe: PE32+ executable (console) x86-64, for MS Windows<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043a\u0430, \u044f \u0434\u0443\u043c\u0430\u044e, \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u0442\u0430\u043a \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e, \u043e\u0434\u043d\u0430\u043a\u043e \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u044f\u043c\u043e \u043a\u0430\u043a \u043c\u0430\u0433\u0438\u044f. \u041e\u0441\u043c\u0435\u043b\u044e\u0441\u044c \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u043a\u0438\u043b\u043b\u0435\u0440-\u0444\u0438\u0447\u0430 Zig, \u0438 \u043e\u043d\u0430 \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0434\u0430\u0436\u0435 \u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0441\u0430\u043c \u044f\u0437\u044b\u043a.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/591979\/\"> https:\/\/habr.com\/ru\/articles\/591979\/<\/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>\u041a\u0430\u0436\u0434\u044b\u0439, \u043a\u0442\u043e \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 C\/C++ \u0447\u0435\u0440\u0435\u0437 \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u0437\u043d\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u044b\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u0413\u043b\u0430\u0432\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c\u0438 \u0441\u0442\u043e\u043b\u044c \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u0435\u0449\u0435\u0439 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u0434\u0440\u0443\u0436\u0435\u043b\u044e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430\u0431\u043e\u0440\u0430 \u0443\u0442\u0438\u043b\u0438\u0442 (\u0442\u0443\u043b\u0447\u0435\u0439\u043d\u0430).<\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0432\u0438\u043d\u043e\u0432\u043d\u0438\u043a\u043e\u0432 \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043e\u043f\u044b\u0442\u0443, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0443\u043b\u0447\u0435\u0439\u043d GNU \u2014 \u0434\u0440\u0435\u0432\u043d\u0438\u0439 \u043c\u0430\u043c\u043e\u043d\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0434\u0435\u0441\u044f\u0442\u0438\u043b\u0435\u0442\u0438\u0439 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0432\u0435\u0441\u044c \u043c\u0438\u0440 POSIX. \u041f\u043e\u0434\u043e\u0431\u043d\u043e \u043c\u043d\u043e\u0433\u0438\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c \u0431\u044b\u043b\u044b\u0445 \u0432\u0440\u0435\u043c\u0451\u043d, \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u043e GCC \u0438 <code>binutils<\/code> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435, \u0438 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0445\u043e\u0442\u044c \u043a\u0430\u043a-\u0442\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0433\u043e \u0431\u044b\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u043b\u043d\u043e\u0439 \u043a\u0440\u043e\u0441\u0441-\u0431\u0438\u043b\u0434-\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0445\u043e\u0441\u0442\u0435.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-407330","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/407330","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=407330"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/407330\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=407330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=407330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=407330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}