Compiling newer version of gcc separately
Hi,
I want to compile a new version gcc but i dont want to upgrade the previous version. I want to have both the version available on my system. I understand that compiling gcc is the only way, since there wont be any binaries for gcc available. Am i right? I have started compiling it anyway, and i have some doubts (rather many!). The way which i am doing now is have 3 dirs srcdir - For all the extracted source codes objdir - Where i actually configure an do a make sysroot - Where i install, using prefix option So the order is, 1. gmp 2. mpfr with the new gmp 3. mpc with the new gmp,mpfr After this i get a good looking bin,lib,share folders in my sysroot. 4. binutils with the new gmp,mpfr,mpc But after this step i get more folders lib64,x86-64-unknown-linux. What is this x86-64-unknown-linux? why does it have a bin and a lib again? Is these steps correct? And my question is will this use all my older system header files? should i install a new linux kernel header files as well, so that it is perfectly updated? 5. gcc - with the new gmp,mpfr,mpc,ld,as,sys-root This is throwing me an error stating system include files is not present in the sysroot/usr/include So what am i doing wrong here, or what have i missed here. Thanks in advance. |
In the last step (5th step) without --sys-root option it says
configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. make[2]: *** [configure-stage1-target-libgcc] Error 1 |
Might be simpler than you imagine.
First : Usually more than one compiler is available in your 'Package Manager', and can be installed. Which Linux OS are you using ? ? All gcc versions 3.2.3 .. 4.7 can be compiled. And: gcc uses no kernel files. Example 4.5, post #2 here http://www.linuxquestions.org/questi...-1-a-842567/#2 4.6 , post #8 here http://www.linuxquestions.org/questi...hine-929660/#8 No gmp, mpfr, mpc needs to be installed, as you can see from the examples. "x86-64-unknown-linux" : No OS was specified. . |
Quote:
I am running Fedora 14, i am trying to build gcc-4.7 I tried putting mpc, mpfr, gmp (the latest versions) inside the gcc folder but it dint work out for me, that is why i went to this option. So i need to have the following pre-requisites: 1.mpc 2.mpfr 3.gmp 4.gcc-g++ 5.binutils-devel 6.glibc-devel 7.elfutils-libelf-devel I have the first 3 but for the next 4, i cannot do a yum install. I have to transfer it to this machine and do it. So i have to download rpm's of it and install it manually. But could you please guide me for the location where i have to install these packages? can i put them under gcc source directory will it be built by itself? And if can provide download locations it will be so helpful. If u cannot never mind, i will find it. |
OK, gcc-4.7 : An example here
http://nosemaj.org/debian-gcc-4-7 Ref. http://www.linuxquestions.org/questi...eeze-936581/#3 |
Quote:
Will that work?? Anyways trying it out now.. But if the glibc is not updated will my gcc be up to date? |
I followed the example link you mentioned, Everything worked fine until the make of gcc.
It throws me this error message - /usr/lib/../lib/crti.o: could not read symbols: File in wrong format collect2: error: ld returned 1 exit status this crti.o is a symlink to the one in /usr/lib64/crti.o |
fedora 14 is PAST it's END OF LIFE
there currently is NO support and there will NEVER be any support install fedora 17 ( testing ONLY alpha/beta) fedora 17 will have gcc 4.7 BY DEFAULT or wait a few weeks for the official fedora 17 release |
Quote:
Even if i update to Fedora17, then in few months there would be an updated version of gcc which i would be needing. So i really need to figure out the way to compile different versions of gcc's. |
there is almost NO reason to update gcc past 4.3
MOST software will not even build in gcc 4.6 let alone 4.7 i ROUTINELY have to drop from gcc 4.5 to 4.3 or 4.1 and even sometimes 3.4 |
Quote:
Quote:
/usr/bin/ld: cannot find crti.o: No such file or directory /usr/bin/ld: skipping incompatible /usr/lib64/libc.so when searching for -lc /usr/bin/ld: cannot find -lc /usr/bin/ld: cannot find crtn.o: No such file or directory collect2: error: ld returned 1 exit status Guys please help me out, i am stuck with this for two full days now.. :banghead: |
you could backport the src.rpm from fedora 17 back to 14
from koji http://koji.fedoraproject.org/koji/p...o?packageID=40 4.7.0 http://koji.fedoraproject.org/koji/b...buildID=308850 also you might want to have a look over at the " End Of Life" section on fedoraforum http://forums.fedoraforum.org/forumdisplay.php?f=75 and have a read ( it is old so you will NEED to update it ) and have a look at the links at the bottom of the page http://www.mjmwired.net/resources/mjm-fedora-gcc.html this is for building an older version of gcc on fedora 15 -- it is close -- http://dummdida.blogspot.com/2011/10...fedora-15.html you WILL WANT to use "--program-suffix=-4.7.0 " in your configure line so you do not kill what is installed then set up "alternatives " so you can move from 4.1 to 4.7 as to the error you have installed the FULL development tools ? right ? for a listing Code:
su - Code:
su - Code:
su - |
Quote:
No i dont have development packages or libraries installed. I was following this link.. http://nosemaj.org/debian-gcc-4-7 So how do i install glibc-devel and other development tools and libraries. I have gmp,mpfr,mpc,ppl,cloog installed into a separate directory. So i prefer installing all the other libraries needed also be installed into this directory. |
the fedora 14 repos are still there - nothing will be added, and in time they will disappear . But they are still up
you still can use "yum" unless this fedora 14 box has no internet connection and if you do not have a internet connection on that box -- it is going to be VERY hard to install anything and WHY are you fallowing a DEBIAN tutorial for Fedora ??? that is like using a GM manual to fix your FORD car - it dose NOT work though that link is fairly generic, except that fedora dose NOT use /usr/local so you will need to install the REQUIRED development software |
Quote:
|
All times are GMT -5. The time now is 04:21 PM. |