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

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
fiveayem
Member
Member
Posts: 51
Joined: Sun Aug 14, 2011 8:01 am

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

Post 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.
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

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

Post by Owen »

Of corse if you intend to build GCC for your OS, you will need working GMP, MPFR, etc for your OS...
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

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

Post 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.
If a trainstation is where trains stop, what is a workstation ?
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

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

Post 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.
Every good solution is obvious once you've found it.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

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

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

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

Post 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.
If a trainstation is where trains stop, what is a workstation ?
Post Reply