{"id":1364,"date":"2020-01-12T19:22:29","date_gmt":"2020-01-12T11:22:29","guid":{"rendered":"http:\/\/bloo.heing.fun\/?p=1364"},"modified":"2020-01-12T19:22:29","modified_gmt":"2020-01-12T11:22:29","slug":"x86_64-wsl%e8%bf%90%e8%a1%8c32%e4%bd%8d%e7%a8%8b%e5%ba%8f","status":"publish","type":"post","link":"https:\/\/bloo.heing.fun\/?p=1364","title":{"rendered":"x86_64 wsl\u8fd0\u884c32\u4f4d\u7a0b\u5e8f"},"content":{"rendered":"<h1 class=\"post-card-title\"><a href=\"https:\/\/greedyhao.cc\/2018\/04\/15\/%E5%B7%A5%E4%BD%9C-Linux-2018-04-15-%E8%A7%A3%E5%86%B3WSL%E6%97%A0%E6%B3%95%E8%BF%90%E8%A1%8C32%E4%BD%8D%E7%A8%8B%E5%BA%8F%E9%97%AE%E9%A2%98\/\">\u89e3\u51b3WSL\u65e0\u6cd5\u8fd0\u884c32\u4f4d\u7a0b\u5e8f\u95ee\u9898<\/a><\/h1>\n<div class=\"post-meta\"><time class=\"post-time\" title=\"2018-04-15 16:47:06\" datetime=\"2018-04-15T08:47:06.000Z\">2018-04-15<\/time>\u00a0<span id=\"busuanzi_container_page_pv\" title=\"\u6587\u7ae0\u603b\u9605\u8bfb\u91cf\">\u00a0<i class=\"icon icon-eye icon-pr\"><\/i><span id=\"busuanzi_value_page_pv\">758<\/span><\/span><\/div>\n<div id=\"post-content\" class=\"post-content\">\n<h1 id=\"\u89e3\u51b3wsl\u65e0\u6cd5\u8fd0\u884c32\u4f4d\u7a0b\u5e8f\u95ee\u9898\">\u89e3\u51b3WSL\u65e0\u6cd5\u8fd0\u884c32\u4f4d\u7a0b\u5e8f\u95ee\u9898<\/h1>\n<p>.\/arm-none-linux-gnueabi-gcc: cannot execute binary file: Exec format error<\/p>\n<p>\u56e0\u4e3a\u6211\u662f\u5b66\u751f\uff0c\u6bd4\u8f83\u7a77\uff0c\u53ea\u6709\u4e00\u53f0\u7535\u8111\uff0c\u800c\u4e14\u6709\u4f7f\u7528Windows\u7684\u9700\u8981\uff0c\u4f46\u662f\u53c8\u9700\u8981\u4f7f\u7528\u5230Linux\uff0c\u6240\u4ee5\u9009\u62e9\u4e86Windows\u5b50\u7cfb\u7edf(WSL)\uff0c\u4f46\u662f\u53d1\u73b0WSL\u4e0d\u652f\u630132\u4f4d\u7a0b\u5e8f\u7684\u8fd0\u884c\uff0c\u5728\u82e6\u82e6\u641c\u7d22\u540e\uff0c\u7ec8\u4e8e\u5728github\u627e\u5230\u4e86\u89e3\u51b3\u65b9\u6cd5\u3002<\/p>\n<p><a id=\"more\"><\/a><strong><a href=\"https:\/\/github.com\/microsoft\/wsl\/issues\/2468#issuecomment-374904520\" target=\"_blank\" rel=\"noopener\">\u89e3\u51b3\u65b9\u6848\u7684\u539f\u94fe\u63a5<\/a><\/strong><\/p>\n<p>\u5fae\u8f6f\u5b98\u65b9\u8bf4\u4e86\uff0c<a href=\"https:\/\/wpdev.uservoice.com\/forums\/266908-command-prompt-console-bash-on-ubuntu-on-windo\/suggestions\/13377507-please-add-32-bit-elf-support-to-the-kernel\" target=\"_blank\" rel=\"noopener\">WSL\u6682\u65f6\u4e0d\u51c6\u5907\u652f\u6301ELF-32\u7684\u8fd0\u884c<\/a>\u3002<\/p>\n<p>\u8981\u6c42\u7cfb\u7edf\u7248\u672c1709, build 16299 \u6216\u4ee5\u4e0a\u3002<\/p>\n<h2 id=\"\u5b89\u88c5qemu-\u548c-binfmt\">\u5b89\u88c5qemu \u548c binfmt<\/h2>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span>\r\n<span class=\"line\">3<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">sudo apt update<\/span>\r\n<span class=\"line\">sudo apt install qemu-user-static<\/span>\r\n<span class=\"line\">sudo update-binfmts --install i386 \/usr\/bin\/qemu-i386-static --magic '\\x7fELF\\x01\\x01\\x01\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x03\\x00\\x01\\x00\\x00\\x00' --mask '\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfc\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xf8\\xff\\xff\\xff\\xff\\xff\\xff\\xff'<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p><strong>\u6ce8\u610f\uff1a<\/strong>\u00a0\u6bcf\u6b21\u91cd\u542fWSL\u540e\u5982\u679c\u9700\u8981i386\u7684\u652f\u6301\u9700\u8981\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">sudo service binfmt-support start<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2 id=\"enable-i386-architecture-and-packages\">Enable i386 architecture and packages<\/h2>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span>\r\n<span class=\"line\">3<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">sudo dpkg --add-architecture i386<\/span>\r\n<span class=\"line\">sudo apt update<\/span>\r\n<span class=\"line\">sudo apt install gcc:i386<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2 id=\"\u6d4b\u8bd5\">\u6d4b\u8bd5<\/h2>\n<figure class=\"highlight plain\">\n<table>\n<tbody>\n<tr>\n<td class=\"gutter\">\n<pre><span class=\"line\">1<\/span>\r\n<span class=\"line\">2<\/span>\r\n<span class=\"line\">3<\/span>\r\n<span class=\"line\">4<\/span>\r\n<span class=\"line\">5<\/span>\r\n<span class=\"line\">6<\/span>\r\n<span class=\"line\">7<\/span>\r\n<span class=\"line\">8<\/span><\/pre>\n<\/td>\n<td class=\"code\">\n<pre><span class=\"line\">$ file arm-none-linux-gnueabi-gcc<\/span>\r\n<span class=\"line\">arm-none-linux-gnueabi-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter \/lib\/ld-linux.so.2, for GNU\/Linux 2.2.5, stripped<\/span>\r\n<span class=\"line\">$ .\/arm-none-linux-gnueabi-gcc -v<\/span>\r\n<span class=\"line\">Using built-in specs.<\/span>\r\n<span class=\"line\">Target: arm-none-linux-gnueabi<\/span>\r\n<span class=\"line\">Configured with: \/scratch\/julian\/2009q3-respin-linux-lite\/src\/gcc-4.4\/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-arch=armv5te --with-gnu-as --with-gnu-ld --with-specs='%{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables} %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared --disable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2009q3-67' --with-bugurl=https:\/\/support.codesourcery.com\/GNUToolchain\/ --disable-nls --prefix=\/opt\/codesourcery --with-sysroot=\/opt\/codesourcery\/arm-none-linux-gnueabi\/libc --with-build-sysroot=\/scratch\/julian\/2009q3-respin-linux-lite\/install\/arm-none-linux-gnueabi\/libc --with-gmp=\/scratch\/julian\/2009q3-respin-linux-lite\/obj\/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu\/usr --with-mpfr=\/scratch\/julian\/2009q3-respin-linux-lite\/obj\/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu\/usr --with-ppl=\/scratch\/julian\/2009q3-respin-linux-lite\/obj\/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu\/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=\/scratch\/julian\/2009q3-respin-linux-lite\/obj\/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu\/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=\/scratch\/julian\/2009q3-respin-linux-lite\/install\/arm-none-linux-gnueabi\/bin --with-build-time-tools=\/scratch\/julian\/2009q3-respin-linux-lite\/install\/arm-none-linux-gnueabi\/bin<\/span>\r\n<span class=\"line\">Thread model: posix<\/span>\r\n<span class=\"line\">gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67)<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<\/div>\n<div id=\"gtx-trans\" style=\"position: absolute; left: -24px; top: -0.999999px;\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u51b3WSL\u65e0\u6cd5\u8fd0\u884c32\u4f4d\u7a0b\u5e8f\u95ee\u9898 2018-04-15\u00a0\u00a0758 \u89e3\u51b3WSL\u65e0\u6cd5\u8fd0\u884c32\u4f4d\u7a0b\u5e8f\u95ee\u9898 .\/arm [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-1364","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts\/1364","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1364"}],"version-history":[{"count":1,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts\/1364\/revisions"}],"predecessor-version":[{"id":1365,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=\/wp\/v2\/posts\/1364\/revisions\/1365"}],"wp:attachment":[{"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1364"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1364"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bloo.heing.fun\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1364"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}