Page 1 of 1

[GCC] How can I make gcc run on my OS ?

Posted: Sun Jan 01, 2012 11:16 am
by fiveayem
Hello,

Having built a cross-compiler for my OS (this compiler runs on Linux), I would now like to become self-hosting by compiling GCC for my own OS. Then I have run the configure script exactly as I did to build GCC for Linux, except that I have added the option --host, with the same value as --target. I have also specified GMP, MPFR and MPC locations (/tmp/gcc).

However, when I do this, I get an error from configure saying that GMP, MPFR and MPC libraries cannot be found (the headers can) :

Code: Select all

checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
And as soon as I remove the --host option, it works.

Should GMP, MPFR and MPC be built again to get it work ?

Thanks for your help.

Re: [GCC] How can I make gcc run on my OS ?

Posted: Sun Jan 01, 2012 2:14 pm
by Owen
Of corse if you intend to build GCC for your OS, you will need working GMP, MPFR, etc for your OS...

Re: [GCC] How can I make gcc run on my OS ?

Posted: Mon Jan 02, 2012 12:30 am
by gerryg400
I think the best way for a cross-compiler is to put the src of those libraries in the gcc tree and build them all together.

Re: [GCC] How can I make gcc run on my OS ?

Posted: Mon Jan 02, 2012 3:06 am
by Solar
Alternatively, you can opt for an older version of GCC. Up to and including the 4.2.x release, GCC didn't have any of those dependencies.

Re: [GCC] How can I make gcc run on my OS ?

Posted: Mon Jan 02, 2012 4:01 am
by Love4Boobies
gerryg400 wrote:I think the best way for a cross-compiler is to put the src of those libraries in the gcc tree and build them all together.
This has been mentioned several times on this forum, not only with regard to GCC. Is this actually possible? If I were a GCC developer, I wouldn't accept any of the OSes on this forum because none of them are full-fledged, stable, and have enough users.

Re: [GCC] How can I make gcc run on my OS ?

Posted: Mon Jan 02, 2012 4:37 am
by gerryg400
Love4Boobies wrote:
gerryg400 wrote:I think the best way for a cross-compiler is to put the src of those libraries in the gcc tree and build them all together.
This has been mentioned several times on this forum, not only with regard to GCC. Is this actually possible? If I were a GCC developer, I wouldn't accept any of the OSes on this forum because none of them are full-fledged, stable, and have enough users.
I meant that instead of building and installing a cross-compiled version of MPFR, GMP, MPC etc. to satisfy GCC's dependencies you can put the src code of those libs in the GCC src tree at build time and the GCC build system will compile them into your cross-compiler.