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

William Harrington kb0iic at berzerkula.org
Fri Apr 14 08:35:40 PDT 2017


On Fri, April 14, 2017 13:27, Michele Bucca wrote:
> Il 14 apr 2017 3:15 PM, "William Harrington" <kb0iic at berzerkula.org> ha
> scritto:
>>
>> On Fri, April 14, 2017 08:15, Michele Bucca 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
>> >
>>
>> Hello Michele,
>>
>> I also wanted to add, in case there is any confusion, that this may shed
>> some light:
>>
>> https://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html
>>
>> Another option, which may be better, is to build gmp, mpfr and mpc
>> in-tree
>> with the GCC source when you build it.  Extract mpfr, gmp and mpc into
>> the
>> source code so it is laid out:
>>
>> gcc-5.3.0/gmp
>> gcc-5.3.0/mpfr
>> gcc-5.3.0/mpc
>> gcc-5.3.0/isl (if also inclulding isl)
>>
>> then configure:  mkdir gcc-build && cd ../gcc-build && (needed flags
>> here)
>> ../gcc-5.3.0/configure (configure options here excluding --with-gmp
>> --with-mpfr --with-mpc)
>>
>
> As I want to build a static version of GCC I will specify these variables:
>
> export CC="i486-linux-musl-gcc -static -Wl,-Bstatic -static-libgcc"
> export CXX="i486-linux-musl-gcc -static -Wl,-Bstatic -static-libgcc"
>
> will this have weird effects if I extract those three libraries source
> inside the GCC source tree and compile them with it?
> --Michele
>
>> Sincerely,
>>
>> William

Hello Michele,

GCC will use the gmp/mpfr/mpc in-tree without issue. I do it quite a bit
with my own cross-compiles. Just make sure you follow the GCC installation
documentation regarding gmp/mpfr/mpc at:

https://gcc.gnu.org/install/prerequisites.html

Also, since this mailing list is specific to the CLFS books, you may wish
to mention which book you are following as a guide for the musl
cross-toolchain build.

Sincerely,

William



More information about the Clfs-support mailing list