Page 1 of 1

building a compiler to build cross compiler

Posted: Fri Jan 12, 2018 9:53 pm
by billcu
My machine is a little old. And I just had to downgrade to a PCI video card. It really sucks. I am using Fedora 20. OK it has gcc-4. Now I want to build gcc-7.2.0. I guess that means "bootstrapping" the wiki says. What is that? Before I can build a i686-elf 7.2.0 I have to update the compiler.

What are the options I want to use. I don't want to wait all day so I will just compile the C compiler. What options should I use with gcc-4 to build gcc-7.2.0?

Quite a jump. I am trying to follow "Bare Bones".

Re: building a compiler to build cross compiler

Posted: Sat Jan 13, 2018 3:39 am
by davidv1992
I would suggest you seriously consider upgrading your linux distribution for starters. The fedora version you are using is 6 versions behind the current, and judging by the fedora website, seems to be out of support for a very significant period of time.

Upgrading will probably give you a newer version of gcc, which should make building newer versions of gcc easier.

Even so, you might need to use in-between versions to get gcc-7 to build using gcc-4. The gcc documentation usually lists the minimum gcc version number, which you can use to check whether, and if so which, intermediate versions you would need to build. Beyond that, building gcc as a normal compiler is relatively straightforward, the usual configure - make - make install sequence should do the trick, but again, the gcc docs are your friend.

Re: building a compiler to build cross compiler

Posted: Sat Jan 13, 2018 1:30 pm
by billcu
Those docs are pretty difficult to sift through. I think it says 4.8 and later. What I would like to do is compile with the latest kernel headers. If that is necessary. I think it would be a good idea. That is the newer compiler to build the cross compiler. The cross isn't to be compiled with headers if I am correct in reading "bare bones".