Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think that you are confused about which package should be compiled for which platform:</p> <ul> <li><p>GCC needs to be compiled for an x86_64 MacOS X host and an i386-linux target.</p></li> <li><p>GMP, MPC and MPFR are runtime dependencies for GCC. Therefore they also need to be compiled for the GCC host - x86_64 in your case. Therefore, the <code>--host=i386-linux</code> option in the GMP configure command is incorrect.</p></li> </ul> <p>In general, only libraries that will be linked in the programs compiled by GCC need to be built for the cross-compiler target (e.g. i386-linux). GMP and MPFR are not such libraries, unless your programs are actually using them - in that case you will need to have two copies of such libraries, one for GCC and a cross-build for the target.</p> <p>EDIT:</p> <p>Have you considered using <a href="http://www.macports.org/" rel="nofollow">MacPorts</a>? It has all the dependencies for your cross-compiler:</p> <ul> <li><p><a href="http://www.macports.org/ports.php?by=library&amp;substr=gmp" rel="nofollow">gmp-5.0.1</a></p></li> <li><p><a href="http://www.macports.org/ports.php?by=name&amp;substr=mpfr" rel="nofollow">mpfr-3.0.0</a></p></li> <li><p><a href="http://www.macports.org/ports.php?by=library&amp;substr=libmpc" rel="nofollow">libmpc-0.8.2</a></p></li> </ul> <p>There is also an older newlib-based cross-compiler for <code>i386</code>:</p> <ul> <li><a href="http://www.macports.org/ports.php?by=name&amp;substr=i386-elf-gcc" rel="nofollow">i386-elf-gcc-4.3.2</a></li> </ul> <p>Even if you do not want to use these, you can still have a look at the build instructions in their Portfiles.</p> <p>The bottom line is:</p> <ul> <li><p>Apply whatever patches these libraries need - MacPorts already do that.</p></li> <li><p>Compile the libraries <em>for your build host</em> i.e. MacOSX/x86_64. That means that in any <code>--host</code> options for their configure calls you should be something along the lines of <code>--host=x86_64-darwin</code> (or whatever your host needs). If configure can figure out the host on its own, you can skip the <code>--host</code> options altogether.</p></li> <li><p>Compile GCC with <code>--host</code> being your <em>build host</em> (the 64-bit Mac OS X) and a target of i386-linux, e.g. <code>--target=i386-linux</code>. If I were you, I'd start simple with a compiler for the C and C++ languages only.</p></li> </ul> <p>See also <a href="http://wiki.osdev.org/GCC_Cross-Compiler" rel="nofollow">this tutorial</a>. It has some information on how to produce a working toolchain with a proper glibc.</p> <p>That said, I think that you'd be better off installing a proper Linux distribution in a virtual machine, for a whole bunch of reasons. Is there a reason for you to need a cross-compiler specifically? What do you want to do with that compiler?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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