Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 3444  / 2 Years ago, mon, december 20, 2021, 5:21:33

I am using Ubuntu 10.04 and the current version of GCC installed in my system is 4.4.
For some specific need I want to install GCC 3.2.



I began with these steps:



$mkdir gcc-build
$cd gcc-build
$tar zxvf gcc-3.2.tar.gz
$mkdir -p gcc-bin
$mkdir -p usr/local
$cd gcc-bin
$../gcc-build/gcc-3.2/configure --prefix=../gcc-build/usr/local


It has configured successfully. But when I used below command



$make bootstrap


I got an error



../gcc-build/gcc-3.2/gcc/read-rtl.c:653: error: lvalue required as increment operand
make[1]: *** [read-rtl.o] Error 1
make[1]: Leaving directory `../gcc-build/gcc-bin/gcc'
make: *** [all-gcc] Error 2


Anybody please help me to resolve this error. Or please suggest some alternative ways. Thanks.


More From » gcc

 Answers
2

After few trials, I found one solution.



I added below mirrors in /etc/apt/sources.list



deb http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb-src http://snapshot.debian.org/archive/debian/20070730T000000Z/ lenny main
deb http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main
deb-src http://snapshot.debian.org/archive/debian-security/20070730T000000Z/ lenny/updates main


With these mirrors, I am able to install GCC 3.3(though not GCC 3.2) using



$sudo apt-get install g++-3.3   


Don't forget to do $sudo apt-get update before above command.



It is in fact satisfying my need.
And to run the program using GCC 3.3, do



$gcc-3.3 input_file



Because otherwise if you type $gcc input_file it will use the default GCC(GCC 4.4 in my case) to compile the program.
We can change the way desired version is used by simply creating a hard link of the version you want to tag to command gcc. We can do the following



$cd /usr/bin
$sudo ln gcc-3.3 gcc


So now whenever you type $gcc input_file it will use your desired gcc version to compile the program.


[#26966] Monday, December 20, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rillrage

Total Points: 122
Total Questions: 120
Total Answers: 103

Location: Tokelau
Member since Thu, Aug 26, 2021
3 Years ago
rillrage questions
;