{"id":186124,"date":"2013-07-10T11:36:02","date_gmt":"2013-07-10T07:36:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=186124"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=186124","title":{"rendered":"<span class=\"post_title\">\u041a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0432 OS X \u043f\u043e\u0434 Linux, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f crosstool-ng<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/bcc\/1f0\/650\/bcc1f0650e2eb42ea3f960b099655999.png\"\/><\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u0440\u043e\u0441\u0441-\u0442\u0443\u043b\u0447\u0435\u0439\u043d\u043e\u0432 <a href=\"http:\/\/crosstool-ng.org\">crosstool-ng<\/a>, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0443\u0432\u0430\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u0435\u0431\u044f embedded-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u043e-\u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e\u043c\u0443 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u043e\u0444\u0442 \u0438\u0437 <font color=\"#d35400\">x86-linux<\/font> \u043f\u043e\u0434 <font color=\"#d35400\">arm-linux<\/font>, \u0442\u043e \u0432\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u043e \u043d\u0451\u043c.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u2014 \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u0434 Linux \u0432 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/Darwin\">Darwin<\/a>.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4><font color=\"#d35400\">Disclaimer<\/font><\/h4>\n<p>\u0412 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u043e \u0441\u0431\u043e\u0440\u043a\u0435 <font color=\"#d35400\">crosstool-ng<\/font> \u043f\u043e\u0434 OS X, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 <a href=\"http:\/\/www.benmont.com\/tech\/crosscompiler.html\">benmont.com<\/a> \u0438 \u0432 <a href=\"http:\/\/crosstool-ng.org\/hg\/crosstool-ng\/file\/8bb5151c5b01\/docs\/C%20-%20Misc.%20tutorials.txt#l41\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435<\/a>. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u0439, \u0430 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u043e\u0431\u0449\u0438\u0435 \u0447\u0435\u0440\u0442\u044b. \u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d \u043c\u043e\u0439 \u043f\u0443\u0442\u044c, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u043b toolchain \u0432 \u0438\u044e\u043b\u0435 2013.<\/p>\n<h4><font color=\"#d35400\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/font><\/h4>\n<p>\u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u043e\u0439 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0432 OS X \u2014 <a href=\"http:\/\/www.macports.org\">MacPorts<\/a> \u0438\u043b\u0438 <a href=\"http:\/\/mxcl.github.io\/homebrew\/\">Homebrew<\/a>. \u042f \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0434\u0430\u0432\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u043b ports-way, \u0442\u0430\u043a \u0447\u0442\u043e \u0431\u0443\u0434\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u044d\u0442\u043e\u0433\u043e.<\/p>\n<h5><font color=\"#d35400\">1. \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430<\/font><\/h5>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e, \u0432 OS X \u0435\u0441\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0430 <font color=\"#d35400\">Disk Utility<\/font>, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0435\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430. \u041f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f 5+ \u0413\u0431.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/758\/011\/82a\/75801182adefcdfef19c9413be76a88d.png\"\/><\/p>\n<h5><font color=\"#d35400\">2. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/font><\/h5>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d MacPorts. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b:<\/p>\n<pre><code class=\"bash\">ncurses lzma libtool binutils gsed gawk grep gcc48 <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 gcc \u0435\u0441\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435: <font color=\"#d35400\">sudo port select &#8212;list gcc<\/font>. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 <font color=\"#d35400\">mp-gcc48<\/font> \u2014 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <font color=\"#d35400\">sudo port select &#8212;set gcc mp-gcc48<\/font>.<\/p>\n<h5><font color=\"#d35400\">3.\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 crosstool-ng<\/font><\/h5>\n<p>\u0421\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0430\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439:<\/p>\n<pre><code class=\"bash\">hg clone http:\/\/crosstool-ng.org\/hg\/crosstool-ng cd crosstool-ng .\/bootstrap <\/code><\/pre>\n<p>  \u0412\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e: \u0432 \u0444\u0430\u0439\u043b\u0435 <font color=\"#d35400\">kconfig\/zconf.hash.c<\/font> \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u0447\u043a\u0438  <\/p>\n<pre><code class=\"cpp\">#include &lt;stddef.h&gt; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">.\/configure \\ --with-objcopy=\/opt\/local\/bin\/gobjcopy \\ --with-objdump=\/opt\/local\/bin\/gobjdump \\ --with-readelf=\/opt\/local\/bin\/greadelf \\ --with-sed=\/opt\/local\/bin\/gsed \\ --with-libtool=\/opt\/local\/bin\/glibtool \\ --with-grep=\/opt\/local\/bin\/grep \\ --with-install=\/opt\/local\/bin\/ginstall make sudo make install <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 <font color=\"#d35400\">ct-ng<\/font> \u0432 <code>\/usr\/local\/bin<\/code>. \u0414\u043e\u043c\u0430\u0448\u043d\u044f\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f ct-ng: <code>\/usr\/local\/lib\/ct-ng.hg+default-2685dfa9de14<\/code> \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0435\u0432\u0438\u0437\u0438\u0438. \u0412 \u044d\u0442\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b <font color=\"#d35400\">scripts\/functions<\/font>, \u0437\u0430\u043c\u0435\u043d\u0438\u0432 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0434\u043b\u044f Darwin \u0441\u0442\u0440\u043e\u0447\u043a\u043e\u0439 \u043e\u0442 Linux:  <\/p>\n<pre><code class=\"diff\">--- scripts\/functions.orig  2013-07-09 22:15:12.000000000 +0400 +++ scripts\/functions   2013-07-06 04:28:41.000000000 +0400 @@ -460,7 +460,7 @@                  mode=&quot;$(stat -c '%a' &quot;$(dirname &quot;${dir}&quot;)&quot;)&quot;                  ;;              Darwin|*BSD) -                mode=&quot;$(stat -f '%Lp' &quot;$(dirname &quot;${dir}&quot;)&quot;)&quot; +                mode=&quot;$(stat -c '%a' &quot;$(dirname &quot;${dir}&quot;)&quot;)&quot;                  ;;              *)                  CT_Abort &quot;Unhandled host OS $CT_SYS_OS&quot; <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e ct-ng \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0445\u0430\u0432\u0430\u0435\u0442 \u0432\u0435\u0440\u0441\u0438\u044e <font color=\"#d35400\">gstat<\/font> \u0438\u0437 GNU-\u043d\u0430\u0431\u043e\u0440\u0430, \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e <font color=\"#d35400\">stat<\/font> \u0438\u0437 OS X. \u041f\u043e\u043b\u044e\u0431\u0443\u0439\u0442\u0435\u0441\u044c \u043a\u0440\u0430\u0441\u043e\u0442\u043e\u0439 \u0438 \u0438\u0437\u044f\u0449\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0434\u0435\u0448\u043d\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u0437\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b.<\/p>\n<p>  \u041c\u043e\u0436\u0435\u0442\u0435 \u0442\u0430\u043a\u0436\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 <font color=\"#d35400\">ct-ng.comp<\/font> \u0434\u043b\u044f <font color=\"#d35400\">bash-completion<\/font>, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0448 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 cross-toolchain \u0438 \u0435\u0433\u043e sysroot. \u0423 \u043c\u0435\u043d\u044f \u044d\u0442\u043e <code>\/Volumes\/Unixen\/ct-config<\/code>, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0432\u0430\u0448\u0443 \u043f\u0430\u043f\u043a\u0443 \u0438 \u043d\u0430\u0447\u043d\u0451\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443.<\/p>\n<h4><font color=\"#d35400\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 crosstool-ng<\/font><\/h4>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043d\u0430\u0447\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443, \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u0430. \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 <font color=\"#d35400\">x86_64-unknown-linux-gnu<\/font>:<\/p>\n<pre><code class=\"bash\">cd \/Volumes\/Unixen\/ct-config ct-ng x86_64-unknown-linux-gnu ct-ng menuconfig <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 \u043c\u0435\u043d\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439.<\/p>\n<h5><font color=\"#d35400\">1. Paths and misc options<\/font><\/h5>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u043f\u0446\u0438\u0438 <font color=\"#d35400\">Local tarballs directory<\/font> (<code>\/Volumes\/Unixen\/src<\/code>) \u0438 <font color=\"#d35400\">Prefix directory<\/font> (<code>\/Volumes\/Unixen\/${CT_TARGET}<\/code>), \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c <code>\/Volumes\/Unixen\/src<\/code>.<\/p>\n<h5><font color=\"#d35400\">2. C compiler<\/font><\/h5>\n<p>\u0417\u0434\u0435\u0441\u044c \u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 Java \u0438 Fortran, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u044e, \u043a\u0430\u043a \u043f\u043e\u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f GCC \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u0441 \u0432\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u043c\u0438 \u0444\u0438\u0447\u0430\u043c\u0438. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c <font color=\"#d35400\">[ ] Link libstdc++ statically into the gcc binary<\/font>, \u0438\u043d\u0430\u0447\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430  <\/p>\n<pre><code class=\"tex\">collect2: error: ld returned 1 exit status ld: library not found for -lcrt0.o  <\/code><\/pre>\n<p>  <\/p>\n<h5><font color=\"#d35400\">3. Debug facilities<\/font><\/h5>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 <font color=\"#d35400\">dmalloc<\/font> \u0438 <font color=\"#d35400\">ltrace<\/font>, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043d\u0430\u0447\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u0440\u0435\u0448\u0430\u0435\u043c\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <font color=\"#d35400\">gdb<\/font> \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c <font color=\"#d35400\">[ ] Native gdb<\/font> \u0438, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c <font color=\"#d35400\">[*] Enable python scripting<\/font> (\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 python, \u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0438\u0436\u0435). \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e <font color=\"#d35400\">gdb version (7.3.1)<\/font>.<\/p>\n<h5><font color=\"#d35400\">4. Companion libraries<\/font><\/h5>\n<p>\u0417\u0434\u0435\u0441\u044c \u0441\u0442\u0440\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0438\u043d\u0430\u0447\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 autotools, \u044d\u0442\u0438 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u043b \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u044b\u043a\u0430, \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u043e\u043c\u043e\u0433\u0430\u043b \u0432\u044b\u0431\u043e\u0440 \u0431\u043e\u043b\u0435\u0435 \u0441\u0432\u0435\u0436\u0435\u0439.  <\/p>\n<pre><code class=\"tex\">      * GMP version (5.0.2)       * MPFR version (3.1.2)       * PPL version (0.11.2)       * CLooG version (0.15.11)       * MPC version (1.0.1) <\/code><\/pre>\n<p>  <\/p>\n<h4><font color=\"#d35400\">\u0421\u0431\u043e\u0440\u043a\u0430 toolchain<\/font><\/h4>\n<p>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 (\u0432\u0435\u0440\u0441\u0438\u044f \u044f\u0434\u0440\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043c\u043e\u044f):  <\/p>\n<pre><code class=\"bash\">[ERROR]    \/Volumes\/Unixen\/ct-config\/.build\/src\/linux-3.8.11\/arch\/x86\/tools\/relocs.c:8:17: fatal error: elf.h: No such file or directory <\/code><\/pre>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043c\u0441\u044f \u043e\u0431 \u044d\u0442\u043e\u043c, \u0432\u0437\u044f\u0432 <font color=\"#d35400\">elf.h<\/font> \u0438\u0437 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430. \u0415\u0441\u043b\u0438 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u043d\u0435\u0442, \u0432\u043e\u0437\u044c\u043c\u0438\u0442\u0435 \u043c\u043e\u0439 <a href=\"http:\/\/f.cl.ly\/items\/3k1d0o0M071v2H102V1k\/elf.h\">elf.h<\/a>. \u041a\u043b\u0430\u0441\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0432 <code>\/usr\/include<\/code>.<\/p>\n<p>  \u0415\u0449\u0451 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043b\u0438\u043c\u0438\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 (<a href=\"http:\/\/sourceware.org\/ml\/crossgcc\/2013-01\/msg00000.html\">RE: Libc iconvdata compilation problem<\/a>):  <\/p>\n<pre><code class=\"bash\">ulimit -n 1024 <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0443 \u0432\u0430\u0441 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 gdb, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b\u0438 <font color=\"#d35400\">[*] Enable python scripting<\/font> \u0440\u0430\u043d\u044c\u0448\u0435:  <\/p>\n<pre><code class=\"bash\">configure: error: python is missing or unusable <\/code><\/pre>\n<p>  \u0442\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b .build\/gdb-*\/gdb\/python\/python-config.py, \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u0441\u0442\u0440\u043e\u043a\u0438  <\/p>\n<pre><code class=\"python\">#            if getvar('LINKFORSHARED') is not None: #                libs.extend(getvar('LINKFORSHARED').split()) <\/code><\/pre>\n<p>  \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0432\u0441\u0451 \u0433\u043e\u0442\u043e\u0432\u043e.  <\/p>\n<pre><code class=\"bash\">ct-ng build <\/code><\/pre>\n<p>  \u041d\u0430 Macbook Air \u0441 i5 \u0441\u0431\u043e\u0440\u043a\u0430 \u0438\u0434\u0451\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 <font color=\"#d35400\">68 \u043c\u0438\u043d\u0443\u0442<\/font>, \u043f\u0440\u0438\u0447\u0451\u043c \u0443 \u0432\u0430\u0441 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0432\u0441\u043f\u043b\u044b\u0432\u0443\u0442 \u043a\u0430\u043a\u0438\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0448\u0438\u0431\u043a\u0438. \u0422\u0430\u043a \u0447\u0442\u043e \u043e\u0442\u043e\u0439\u0442\u0438 \u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<h4><font color=\"#d35400\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/font><\/h4>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/bf2\/f75\/270\/bf2f752701e113a330c03ea1d3cf044c.png\"\/><\/p>\n<p>  <font color=\"#d35400\">\/Volumes\/Unixen $ du -csh ct-config\/<\/font><\/p>\n<pre><code class=\"tex\">4,0G    ct-config\/ 4,0G    \u0438\u0442\u043e\u0433\u043e <\/code><\/pre>\n<p>  <font color=\"#d35400\">\/Volumes\/Unixen $ x86_64-unknown-linux-gnu\/bin\/x86_64-unknown-linux-gnu-gcc -v<\/font><\/p>\n<pre><code class=\"tex\">Using built-in specs. COLLECT_GCC=x86_64-unknown-linux-gnu\/bin\/x86_64-unknown-linux-gnu-gcc COLLECT_LTO_WRAPPER=\/Volumes\/Unixen\/x86_64-unknown-linux-gnu\/libexec\/gcc\/x86_64-unknown-linux-gnu\/4.7.3\/lto-wrapper Configured with: \/Volumes\/Unixen\/ct-config\/.build\/src\/gcc-4.7.3\/configure --build=x86_64-build_apple-darwin12.4.0 --host=x86_64-build_apple-darwin12.4.0 --target=x86_64-unknown-linux-gnu --prefix=\/Volumes\/Unixen\/x86_64-unknown-linux-gnu --with-sysroot=\/Volumes\/Unixen\/x86_64-unknown-linux-gnu\/x86_64-unknown-linux-gnu\/sysroot --enable-languages=c,c++ ..... Target: x86_64-unknown-linux-gnu Thread model: posix gcc version 4.7.3 (crosstool-NG hg+default-2685dfa9de14)  <\/code><\/pre>\n<p>  <font color=\"#d35400\">\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043e\u0431\u0440\u0430\u0442\u044c:<\/font>  <\/p>\n<pre><code class=\"tex\">cd linux-source-3.9 export PATH=$PATH:\/Volumes\/Unixen\/x86_64-unknown-linux-gnu\/bin export C_INCLUDE_PATH=\/usr\/include:\/opt\/local\/include:\/Volumes\/Unixen\/x86_64-unknown-linux-gnu\/x86_64-unknown-linux-gnu\/sysroot\/usr\/include make ARCH=x86_64 CROSS_COMPILE=x86_64-unknown-linux-gnu- all -j4 <\/code><\/pre>\n<p>  \u0423\u0441\u043f\u0435\u0445\u043e\u0432,<br \/>  Xlab was there.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/186124\/\"> http:\/\/habrahabr.ru\/post\/186124\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/bcc\/1f0\/650\/bcc1f0650e2eb42ea3f960b099655999.png\"\/><\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u0440\u043e\u0441\u0441-\u0442\u0443\u043b\u0447\u0435\u0439\u043d\u043e\u0432 <a href=\"http:\/\/crosstool-ng.org\">crosstool-ng<\/a>, \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0443\u0432\u0430\u0436\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u0435\u0431\u044f embedded-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u043e-\u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e\u043c\u0443 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u043e\u0444\u0442 \u0438\u0437 <font color=\"#d35400\">x86-linux<\/font> \u043f\u043e\u0434 <font color=\"#d35400\">arm-linux<\/font>, \u0442\u043e \u0432\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u043e \u043d\u0451\u043c.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u2014 \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u043e\u0434 Linux \u0432 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/Darwin\">Darwin<\/a>.  <\/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-186124","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/186124","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=186124"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/186124\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=186124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=186124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=186124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}