[Clfs-support] [Native Compiler] Problem Cross-compiling GMP MPFR and MPC

Michele Bucca michele.bucca at gmail.com
Fri Apr 14 05:51:04 PDT 2017


Il 14 apr 2017 2:35 PM, "William Harrington" <kb0iic at berzerkula.org> ha
scritto:
>
> On Fri, 14 Apr 2017 10:15:36 +0200
> Michele Bucca <michele.bucca at gmail.com> wrote:
>
> > Hello Everyone,
> >
> > I'm trying to cross-compile a native host-x-host compiler with the
> > musl-libc library
> >
> > To do that I have to
> >
> > 1) compile a cross-compiler. (Done)
> > 2) Install GMP, MPFR and MPC on the cross-compiler
> > 3) make a host-x-host cross-compile to make a native compiler
> >
> > Now I'm stuck compiling the GMP, MPFR and MPC...
> >
> > I had problems with MPFR because when I tried to compile them with the
> > following configure switches
> >
> > ../mpfr-3.1.4/configure --host=i486-linux-musl
> > --prefix=/home/michele/tmp/musl-native-toolchain/native/i486-linux-musl/
> >
> > it produced me x86_64 libraries! (My host is x86_64-linux-gnu)
> >
> > So I changed the configure switch like that:
> >
> > ../mpfr-3.1.4/configure --host=i486-linux-musl
> > --build=x86_64-linux-gnu
> > --prefix=/home/michele/tmp/musl-native-toolchain/native/i486-linux-musl/
> >
> > and it compiled well..
> >
> > Now I'm having problems building MPC for the same reason: the
> > configure is like this:
> >
> > ../mpc-1.0.3/configure --host=i486-linux-musl
> > --build=x86_64-linux-gnu
> > --prefix=/home/michele/tmp/musl-native-toolchain/native/i486-linux-musl/
> >
> > what am I doing wrong?
> >
>
> Hello Michele,
>
> First you need to understand the difference between host, build, and
target...
>
>
https://www.gnu.org/software/autoconf/manual/autoconf-2.65/html_node/Specifying-Target-Triplets.html
>
> You ended up with 64bit libraries because build defaulted to your host
compiler.
>
> build and host can be the same, but build will use the toolchain you need
a target when cross-compiling.
>
> 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):
>
> --build=x86_64-cross-linux-gnu
> --host=x86_64-cross-linux-gnu
> --target=i486-linux-musl
>
> After the cross-toolchain is built, then you can use (example):
>
> --host=i486-linux-musl
> --build=x86_64-cross-linux-gnu
>
> If there is any confusion, you can look at he main cross-lfs CLFS book as
a guide.
>

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)

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!

-- Michele
> Sincerely,
>
> William
> _______________________________________________
> Clfs-support mailing list
> Clfs-support at lists.clfs.org
> http://lists.clfs.org/listinfo.cgi/clfs-support-clfs.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clfs.org/pipermail/clfs-support-clfs.org/attachments/20170414/e9332893/attachment-0002.htm>


More information about the Clfs-support mailing list