<p dir="ltr"><br>
Il 15 apr 2017 9:58 AM, "akhiezer" <<a href="mailto:lfs65@cruziero.com">lfs65@cruziero.com</a>> ha scritto:<br>
><br>
> > From: Michele Bucca <<a href="mailto:michele.bucca@gmail.com">michele.bucca@gmail.com</a>><br>
> > Date: Sat, 15 Apr 2017 09:18:24 +0200<br>
> > To: CLFS Support <<a href="mailto:clfs-support@lists.clfs.org">clfs-support@lists.clfs.org</a>><br>
> > Subject: Re: [Clfs-support] [Native Compiler] Problem Cross-compiling GMP<br>
> >  MPFR and MPC<br>
> ><br>
> > Il 14 apr 2017 5:34 PM, "William Harrington" <<a href="mailto:kb0iic@berzerkula.org">kb0iic@berzerkula.org</a>> ha scritto:<br>
> > ><br>
> > > On Fri, April 14, 2017 13:27, Michele Bucca wrote:<br>
> > > > Il 14 apr 2017 3:15 PM, "William Harrington" <<a href="mailto:kb0iic@berzerkula.org">kb0iic@berzerkula.org</a>> ha<br>
> > > > scritto:<br>
> > > >><br>
> > > >> On Fri, April 14, 2017 08:15, Michele Bucca wrote:<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>
> > > >><br>
> > > >> Hello Michele,<br>
> > > >><br>
> > > >> I also wanted to add, in case there is any confusion, that this may shed<br>
> > > >> some light:<br>
> > > >><br>
> > > >> <a href="https://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html">https://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html</a><br>
> > > >><br>
> > > >> Another option, which may be better, is to build gmp, mpfr and mpc<br>
> > > >> in-tree<br>
> > > >> with the GCC source when you build it.  Extract mpfr, gmp and mpc into<br>
> > > >> the<br>
> > > >> source code so it is laid out:<br>
> > > >><br>
> > > >> gcc-5.3.0/gmp<br>
> > > >> gcc-5.3.0/mpfr<br>
> > > >> gcc-5.3.0/mpc<br>
> > > >> gcc-5.3.0/isl (if also inclulding isl)<br>
> > > >><br>
> > > >> then configure:  mkdir gcc-build && cd ../gcc-build && (needed flags<br>
> > > >> here)<br>
> > > >> ../gcc-5.3.0/configure (configure options here excluding --with-gmp<br>
> > > >> --with-mpfr --with-mpc)<br>
> > > >><br>
> > > ><br>
> > > > As I want to build a static version of GCC I will specify these variables:<br>
> > > ><br>
> > > > export CC="i486-linux-musl-gcc -static -Wl,-Bstatic -static-libgcc"<br>
> > > > export CXX="i486-linux-musl-gcc -static -Wl,-Bstatic -static-libgcc"<br>
> > > ><br>
> > > > will this have weird effects if I extract those three libraries source<br>
> > > > inside the GCC source tree and compile them with it?<br>
> > > > --Michele<br>
> > > ><br>
> > > >> Sincerely,<br>
> > > >><br>
> > > >> William<br>
> > ><br>
> > > Hello Michele,<br>
> > ><br>
> > > GCC will use the gmp/mpfr/mpc in-tree without issue. I do it quite a bit<br>
> > > with my own cross-compiles. Just make sure you follow the GCC installation<br>
> > > documentation regarding gmp/mpfr/mpc at:<br>
> > ><br>
> > > <a href="https://gcc.gnu.org/install/prerequisites.html">https://gcc.gnu.org/install/prerequisites.html</a><br>
> > ><br>
> > > Also, since this mailing list is specific to the CLFS books, you may wish<br>
> > > to mention which book you are following as a guide for the musl<br>
> > > cross-toolchain build.<br>
> ><br>
> > I'm following CLFS-Embedded (Development)<br>
><br>
><br>
> You _say_ here that you are 'following' clfs-embedded-dev ... tho'<br>
> don't say _which_ variant of it ...<br>
></p>
<p dir="ltr">CLFS-EMBEDDED GIT-20161228-X86</p>
<p dir="ltr">><br>
> ><br>
> > ><br>
> > > Sincerely,<br>
> > ><br>
> > > William<br>
> ><br>
> > To compile GCC (the first pass) first I export some variables<br>
> ><br>
> > export CC="i486-linux-musl-gcc -static -Wl,-Bstatic -static-libgcc"<br>
> > export CXX="i486-linux-musl-g++ -static -Wl,-Bstatic -static-libgcc"<br>
> ><br>
> > This should make the gcc executable static<br>
> ><br>
> > ../gcc-6.2.0/configure \<br>
> >   --prefix=/home/michele/tmp/musl-native-toolchain/output \<br>
> >   --build=x86_64-linux-gnu \<br>
> >   --host=i486-linux-musl \<br>
> >   --target=i486-linux-musl \<br>
> >   --disable-nls  \<br>
> >   --disable-shared \<br>
> >   --without-headers \<br>
> >   --with-newlib \<br>
> >   --disable-decimal-float \<br>
> >   --disable-libgomp \<br>
> >   --disable-libmudflap \<br>
> >   --disable-libssp \<br>
> >   --disable-libatomic \<br>
> >   --disable-libquadmath \<br>
> >   --disable-threads \<br>
> >   --enable-languages=c \<br>
> >   --disable-multilib \<br>
> ><br>
><br>
><br>
>  ... but here you are _clearly_ _not_ 'following' clfs-embedded-dev:<br>
> where, e.g., are the mpfr/mpc/gmp .</p>
<p dir="ltr">What I wanted to do in the first place was to install libgmp libmpfr and libmpc inside the toolchain so that it could be used to build a static gcc binary</p>
<p dir="ltr">><br>
><br>
> > then I give the commands<br>
> ><br>
> > make all-gcc all-target-libgcc<br>
> ><br>
> ><br>
> > but the compile process fails with this error<br>
> ><br>
> > # If this is the top-level multilib, build all the other<br>
> > # multilibs.<br>
> > i486-linux-musl-gcc   -g -O2 -O2  -g -O2 -DIN_GCC    -W -Wall<br>
> > -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes<br>
> > -Wmissing-prototypes -Wold-style-definition  -isystem ./include<br>
> > -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2<br>
> > -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -fpic<br>
> > -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc<br>
> > -I../../../gcc-6.2.0/libgcc -I../../../gcc-6.2.0/libgcc/.<br>
> > -I../../../gcc-6.2.0/libgcc/../gcc<br>
> > -I../../../gcc-6.2.0/libgcc/../include<br>
> > -I../../../gcc-6.2.0/libgcc/../libdecnumber/no<br>
> > -I../../../gcc-6.2.0/libgcc/../libdecnumber -DHAVE_CC_TLS  -DUSE_TLS<br>
> > -o decLibrary.o -MT decLibrary.o -MD -MP -MF decLibrary.dep -c<br>
> > ../../../gcc-6.2.0/libgcc/../libdecnumber/decLibrary.c<br>
> > ../../../gcc-6.2.0/libgcc/../libdecnumber/decLibrary.c:27:24: fatal<br>
> > error: decimal128.h: No such file or directory<br>
> >  #include "decimal128.h"<br>
> >                         ^<br>
> > compilation terminated.<br>
> > Makefile:612: set di istruzioni per l'obiettivo "decLibrary.o" non riuscito<br>
> > make[1]: *** [decLibrary.o] Errore 1<br>
> > make[1]: uscita dalla directory<br>
> > "/home/michele/tmp/musl-native-toolchain/obj-gcc/i486-linux-musl/libgcc"<br>
> > Makefile:12314: set di istruzioni per l'obiettivo "all-target-libgcc"<br>
> > non riuscito<br>
> > make: *** [all-target-libgcc] Errore 2<br>
> ><br>
> > I don't use the sysroot so I can move the toolchain in a different<br>
> > directory without breaking it. Yes I know that the host and target<br>
> > swith are the same..I want to obtain a compiler like the one that is<br>
> > used to create a CLFS temporary system.<br>
> ><br>
> ><br>
> > See Here:<br>
> > <a href="http://www.clfs.org/view/CLFS-3.0.0-SYSVINIT/x86/temp-system/gcc.html">http://www.clfs.org/view/CLFS-3.0.0-SYSVINIT/x86/temp-system/gcc.html</a><br>
> ><br>
><br>
><br>
>  ... and now you're referring to a non-embedded, non-dev book.<br>
><br>
><br>
> ><br>
> > Any help? Thanks<br>
> ><br>
><br>
><br>
> Are you trying to follow clfs-embedded-dev-x86, but are trying to do<br>
> mpfr/mpc/gmp as separate steps from gcc ?</p>
<p dir="ltr">See above</p>
<p dir="ltr">><br>
><br>
> Have you built clfs-embedded-dev-x86 as-is, from start to end, at least<br>
> once successfully yet, prior to any deviations from the book?<br>
><br>
Yes<br>
><br>
-- Michele _______________________________________________<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>