Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://ymorin.is-a-geek.org/projects/crosstool#cygwin_as_host" rel="noreferrer">crosstool-ng supports building cross-compilers with cygwin host</a>.</p> <p>Overview:</p> <ul> <li>Install cygwin, with development packages</li> <li><a href="http://ymorin.is-a-geek.org/download/crosstool-ng/" rel="noreferrer">Download <code>crosstool-ng</code></a></li> <li>Extract the tarball (<code>tar xvjf crosstool-ng*</code>)</li> <li>Run <code>./configure</code></li> <li>When configure complains about a missing tool, go back to cygwin setup and install the corresponding package (e.g. <code>flex</code>, <code>libtool</code>, <code>ncurses-devel</code>) You'll need at least the following: <ul> <li>Devel/gperf</li> <li>Devel/bison</li> <li>Devel/byacc</li> <li>Devel/wget</li> <li>Devel/patch</li> <li>Devel/make (GNU version)</li> <li>Devel/automake 1.10+</li> <li>Libs/libncursesw10</li> <li>Libs/libncursesw10-devel</li> </ul></li> <li><code>make</code></li> <li><code>make install</code></li> <li>Create a new directory for building the cross-compiler, e.g. <code>/usr/src/cross-linux-gnu-root</code></li> <li>Enable system-wide case sensitivity support in the registry (see <a href="https://superuser.com/questions/266110/how-do-you-make-windows-7-fully-case-sensitive-with-respect-to-the-filesystem#answer-842670">https://superuser.com/questions/266110/how-do-you-make-windows-7-fully-case-sensitive-with-respect-to-the-filesystem#answer-842670</a>)</li> <li>Mount the directory case-sensitive (e.g. <code>mount c:/cygwin/usr/src/cross-linux-gnu-root /usr/src/cross-linux-gnu -o binary,posix=1</code>)</li> <li>From inside the cross-compiler build directory, <code>ct-ng menuconfig</code></li> <li>In the menus, set target architecture to <code>x86</code> (probably) and subarchitecture to <code>i686</code> (avoids <a href="https://bugzilla.redhat.com/show_bug.cgi?id=917161#c6" rel="noreferrer">GCC 4.8 issues</a>, thanks osm0sis), target kernel to <code>linux</code>, and target C library to <code>glibc</code>, and enable the C++ compiler.</li> <li>To work around <a href="http://crosstool-ng.org/download/ibot-logs/2013-11-03.html" rel="noreferrer">make 4.0 issues</a>, also enable EXPERIMENTAL in <code>Paths and misc options</code> then, go in <code>Companion tools</code> (at top-level) and enable <code>Build some companion tools</code> and then <code>make 3.81</code> (Thanks osm0sis)</li> <li>wget has issues with the latest kernel.org certificates so use the .wgetrc method in this accepted answer: <a href="https://stackoverflow.com/questions/9224298/how-do-i-fix-certificate-errors-when-running-wget-on-an-https-url-in-cygwin">How do I fix certificate errors when running wget on an HTTPS URL in Cygwin?</a> (Thanks osm0sis)</li> <li>Currently 3 file patches are required to avoid further errors: <ul> <li><a href="http://sourceware.org/ml/crossgcc/2012-05/msg00012.html" rel="noreferrer">the _libintl_gettext error</a> as mentioned in the comments</li> <li><a href="https://lkml.org/lkml/2013/4/28/84" rel="noreferrer">the byteshift headers</a>, and</li> <li><a href="http://forum.xda-developers.com/showthread.php?p=51726566#post51726566" rel="noreferrer">the ELF headers</a> (Thanks Duncan Calvert &amp; osm0sis)</li> </ul></li> <li><code>ct-ng build</code></li> </ul> <p>Of course, this is NOT going to enable you to build linux applications from inside Visual Studio. (VS2010 and later let you build with other toolchains such as gcc, but you'd need an appropriate toolchain description in addition to the cross-compiler built by crosstool-ng). But you'll have a working <code>g++-linux-gnu</code>, which you can either run directly or using a Makefile.</p> <p>NOTE: Building the cross-compiler takes a LONG time. osm0sis has provided <a href="http://forum.xda-developers.com/showthread.php?p=51726566#post51726566" rel="noreferrer">a prebuilt gcc 4.8.1 here</a>, along with his notes on building the cross-compiler (used to update this answer).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload