Setting up a Cross Compiler

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Post Reply
User avatar
jinksys
Posts: 20
Joined: Tue May 20, 2008 4:52 pm
Location: St Louis, Missouri, USA

Setting up a Cross Compiler

Post by jinksys »

I was following the cross compiler tutorial verbatim and ran into a roadblock when configuring gcc:

Code: Select all

checking for correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.0+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.
cygwin doesn't install libgmp and libmpfr by default so I had to hunt them down. I don't know if this would qualify as something wikiworthy, but while gcc-core, bison, flex, etc are listed under the DEVEL category in cygwin, libgmp and libmpfr are under the LIBS category.

edit: you might think to yourself, "well duh, libgmp is under LIBS because it's a lib, and gcc is under devel because it's a dev-tool, dummy" While that is true, it becomes confusing because there are also libs under devel and devel tools under libs.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

I have tracked the source, and it comes down to a few things:
1) GCC 4.3.0 is only out for two months now
2) It is probably the first version of GCC that actually requires GMP. All the previous versions do not need it.
3) somebody filled in the data in the matrix without having exactly followed the tutorial (i.e. has installed more)

#1 is why you are the first to find out about it.
#3 is just bad, and I fixed the matrix correspondingly
#2 is the actual source of the problem, and it just looks like they added more unnecessary bloat to the compiler. (they provide arbitrary-precision maths, but it is beyond me why they can't just substitute from the C library's math.h when that's possible)

I also wonder whether this change is going to cause trouble for people going self-hosted, as they suddenly need to provide an additional library to compile GCC...


but thanks for pointing it out

Edit: typo fixed
Last edited by Combuster on Mon May 26, 2008 5:22 pm, edited 1 time in total.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Zenith
Member
Member
Posts: 224
Joined: Tue Apr 10, 2007 4:42 pm

Post by Zenith »

Yeah, I experienced that problem the first time I tried to compile it on Cygwin (I got it 2 days after it came out, :shock: ) - I just installed the libraries and voila!

This might pose a problem for future self-hosters who want the 'latest and greatest' version of GCC, but I'm assuming/hoping these libraries are not OS-dependent...

I partially agree that there should be a wiki article for installing or porting these libraries, once this issue becomes 'significant' after a while...

PS: Don't you mean GCC 4.3.0?
"Sufficiently advanced stupidity is indistinguishable from malice."
Post Reply