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

akhiezer lfs65 at cruziero.com
Sat Apr 15 00:58:07 PDT 2017


> From: Michele Bucca <michele.bucca at gmail.com>
> Date: Sat, 15 Apr 2017 09:18:24 +0200
> To: CLFS Support <clfs-support at lists.clfs.org>
> Subject: Re: [Clfs-support] [Native Compiler] Problem Cross-compiling GMP
>  MPFR and MPC
>
> Il 14 apr 2017 5:34 PM, "William Harrington" <kb0iic at berzerkula.org> ha scritto:
> >
> > 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.
>
> I'm following CLFS-Embedded (Development)


You _say_ here that you are 'following' clfs-embedded-dev ... tho'
don't say _which_ variant of it ...


>
> >
> > Sincerely,
> >
> > William
>
> To compile GCC (the first pass) first I export some variables
>
> export CC="i486-linux-musl-gcc -static -Wl,-Bstatic -static-libgcc"
> export CXX="i486-linux-musl-g++ -static -Wl,-Bstatic -static-libgcc"
>
> This should make the gcc executable static
>
> ../gcc-6.2.0/configure \
>   --prefix=/home/michele/tmp/musl-native-toolchain/output \
>   --build=x86_64-linux-gnu \
>   --host=i486-linux-musl \
>   --target=i486-linux-musl \
>   --disable-nls  \
>   --disable-shared \
>   --without-headers \
>   --with-newlib \
>   --disable-decimal-float \
>   --disable-libgomp \
>   --disable-libmudflap \
>   --disable-libssp \
>   --disable-libatomic \
>   --disable-libquadmath \
>   --disable-threads \
>   --enable-languages=c \
>   --disable-multilib \
>


 ... but here you are _clearly_ _not_ 'following' clfs-embedded-dev:
where, e.g., are the mpfr/mpc/gmp .


> then I give the commands
>
> make all-gcc all-target-libgcc
>
>
> but the compile process fails with this error
>
> # If this is the top-level multilib, build all the other
> # multilibs.
> i486-linux-musl-gcc   -g -O2 -O2  -g -O2 -DIN_GCC    -W -Wall
> -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
> -Wmissing-prototypes -Wold-style-definition  -isystem ./include
> -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2
> -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -fpic
> -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc
> -I../../../gcc-6.2.0/libgcc -I../../../gcc-6.2.0/libgcc/.
> -I../../../gcc-6.2.0/libgcc/../gcc
> -I../../../gcc-6.2.0/libgcc/../include
> -I../../../gcc-6.2.0/libgcc/../libdecnumber/no
> -I../../../gcc-6.2.0/libgcc/../libdecnumber -DHAVE_CC_TLS  -DUSE_TLS
> -o decLibrary.o -MT decLibrary.o -MD -MP -MF decLibrary.dep -c
> ../../../gcc-6.2.0/libgcc/../libdecnumber/decLibrary.c
> ../../../gcc-6.2.0/libgcc/../libdecnumber/decLibrary.c:27:24: fatal
> error: decimal128.h: No such file or directory
>  #include "decimal128.h"
>                         ^
> compilation terminated.
> Makefile:612: set di istruzioni per l'obiettivo "decLibrary.o" non riuscito
> make[1]: *** [decLibrary.o] Errore 1
> make[1]: uscita dalla directory
> "/home/michele/tmp/musl-native-toolchain/obj-gcc/i486-linux-musl/libgcc"
> Makefile:12314: set di istruzioni per l'obiettivo "all-target-libgcc"
> non riuscito
> make: *** [all-target-libgcc] Errore 2
>
> I don't use the sysroot so I can move the toolchain in a different
> directory without breaking it. Yes I know that the host and target
> swith are the same..I want to obtain a compiler like the one that is
> used to create a CLFS temporary system.
>
>
> See Here:
> http://www.clfs.org/view/CLFS-3.0.0-SYSVINIT/x86/temp-system/gcc.html
>


 ... and now you're referring to a non-embedded, non-dev book.


>
> Any help? Thanks
>


Are you trying to follow clfs-embedded-dev-x86, but are trying to do
mpfr/mpc/gmp as separate steps from gcc ?


Have you built clfs-embedded-dev-x86 as-is, from start to end, at least
once successfully yet, prior to any deviations from the book?


> -- Michele
>



akh





--



More information about the Clfs-support mailing list