<p dir="ltr"><br>
Il 14 apr 2017 2:35 PM, "William Harrington" <<a href="mailto:kb0iic@berzerkula.org">kb0iic@berzerkula.org</a>> ha scritto:<br>
><br>
> On Fri, 14 Apr 2017 10:15:36 +0200<br>
> Michele Bucca <<a href="mailto:michele.bucca@gmail.com">michele.bucca@gmail.com</a>> wrote:<br>
><br>
> > Hello Everyone,<br>
> ><br>
> > I'm trying to cross-compile a native host-x-host compiler with the<br>
> > musl-libc library<br>
> ><br>
> > To do that I have to<br>
> ><br>
> > 1) compile a cross-compiler. (Done)<br>
> > 2) Install GMP, MPFR and MPC on the cross-compiler<br>
> > 3) make a host-x-host cross-compile to make a native compiler<br>
> ><br>
> > Now I'm stuck compiling the GMP, MPFR and MPC...<br>
> ><br>
> > I had problems with MPFR because when I tried to compile them with the<br>
> > following configure switches<br>
> ><br>
> > ../mpfr-3.1.4/configure --host=i486-linux-musl<br>
> > --prefix=/home/michele/tmp/musl-native-toolchain/native/i486-linux-musl/<br>
> ><br>
> > it produced me x86_64 libraries! (My host is x86_64-linux-gnu)<br>
> ><br>
> > So I changed the configure switch like that:<br>
> ><br>
> > ../mpfr-3.1.4/configure --host=i486-linux-musl<br>
> > --build=x86_64-linux-gnu<br>
> > --prefix=/home/michele/tmp/musl-native-toolchain/native/i486-linux-musl/<br>
> ><br>
> > and it compiled well..<br>
> ><br>
> > Now I'm having problems building MPC for the same reason: the<br>
> > configure is like this:<br>
> ><br>
> > ../mpc-1.0.3/configure --host=i486-linux-musl<br>
> > --build=x86_64-linux-gnu<br>
> > --prefix=/home/michele/tmp/musl-native-toolchain/native/i486-linux-musl/<br>
> ><br>
> > what am I doing wrong?<br>
> ><br>
><br>
> Hello Michele,<br>
><br>
> First you need to understand the difference between host, build, and target...<br>
><br>
> <a href="https://www.gnu.org/software/autoconf/manual/autoconf-2.65/html_node/Specifying-Target-Triplets.html">https://www.gnu.org/software/autoconf/manual/autoconf-2.65/html_node/Specifying-Target-Triplets.html</a><br>
><br>
> You ended up with 64bit libraries because build defaulted to your host compiler.<br>
><br>
> build and host can be the same, but build will use the toolchain you need a target when cross-compiling.<br>
><br>
> In this case, build and host is the same because are most likely using the same machine to create the cross-compiler and use that cross-compiler (example):<br>
><br>
> --build=x86_64-cross-linux-gnu<br>
> --host=x86_64-cross-linux-gnu<br>
> --target=i486-linux-musl<br>
><br>
> After the cross-toolchain is built, then you can use (example):<br>
><br>
> --host=i486-linux-musl<br>
> --build=x86_64-cross-linux-gnu<br>
><br>
> If there is any confusion, you can look at he main cross-lfs CLFS book as a guide.<br>
></p>
<p dir="ltr">The cross-compiler is ready. Now I need to install the GMP MPFR and MPC libraries inside the cross-compiler so that I can use them to compile GCC a second time as a native static compiler (I want gcc, g++, ld, etc..not i486-linux-musl-gcc)</p>
<p dir="ltr">But when I follow the instructions to compile those libraries with --host=i486-linux-musl and --build=x86_64-linux-gnu I obtain libraries that are for x86_64-linux-gnu!</p>
<p dir="ltr">-- Michele<br>
> Sincerely,<br>
><br>
> William<br>
> _______________________________________________<br>
> Clfs-support mailing list<br>
> <a href="mailto:Clfs-support@lists.clfs.org">Clfs-support@lists.clfs.org</a><br>
> <a href="http://lists.clfs.org/listinfo.cgi/clfs-support-clfs.org">http://lists.clfs.org/listinfo.cgi/clfs-support-clfs.org</a><br>
</p>