LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 06-28-2005, 10:22 PM   #1
nelnel
Member
 
Registered: May 2005
Posts: 47

Rep: Reputation: 15
downgrade of GCC version


hi,

i need to downgrade the GCC version from 3.2 to v.2.95. Then i download the gcc v.2.95.3 from GCC homepage.

after i run...
$./configure
$make
$make install

i check the version of the GCC, it still is the version 3.2.

[root@H733-00011 gcc-2.95.3]# gcc --version
gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

How could i confirm the installation has been completed? And how could i know that the gcc compiler is using v.2.95.3 but not v.3.2?

thx for help
 
Old 06-28-2005, 11:22 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 3,990

Rep: Reputation: 261Reputation: 261Reputation: 261
If you didn't set the --prefix argument to ./configure, the new gcc got installed in /usr/local/bin instead of /usr/bin. Try /usr/local/bin/gcc --version. If that's the case, you can either put /usr/local/bin ahead of /usr/bin in your PATH or set the CC environment variable to point to /usr/local/bin/gcc.

BTW there's nothing wrong with having two versions of gcc on your system, and it may be a bad idea to ditch your system's default C compiler.
 
Old 06-28-2005, 11:39 PM   #3
Noth
Member
 
Registered: Jun 2005
Distribution: Debian
Posts: 356

Rep: Reputation: 30
Unless you have a very good reason, I would avoid installing gcc 2.95. It's been deprecated for a while now, hell gcc 4 was released in April.
 
Old 06-29-2005, 12:27 AM   #4
nelnel
Member
 
Registered: May 2005
Posts: 47

Original Poster
Rep: Reputation: 15
thx for ur suggestion.

In fact, i don't want to use gcc v.2.95, but it is required by Oracle Client 9i OCCI. I can't use others version to conn the Oracle via OCCI. The only solution provided by the oracle forum is using gcc v.2.95.....s
 
Old 06-29-2005, 12:30 AM   #5
Noth
Member
 
Registered: Jun 2005
Distribution: Debian
Posts: 356

Rep: Reputation: 30
Well if your'e running Oracle, you're probably running it on a supported OS like RH AS, right? Well there are gcc compat packages on the CDs that should do what you want.
 
Old 06-29-2005, 12:30 AM   #6
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
it's not quite that easy to compile gcc 2.95
but first it's good you jusy did ./configure
that put the new gcc in /usr/local
and left your system compiler in /usr
you really don't want to overwrite your system compiler and you didn't bravo
now when you want to use gcc 2.95.3 you do
export PATH=/usr/local/gcc-2.95.3/bin:$PATH
and
export CC=/usr/local/gcc-2.95.3/bin/gcc
and your system will use it
next time you install another compiler remember to do ./configure --prefix=/opt/gcc-x.xx.x
or you overwrite your second one gcc 2.95 in /usr/local

OK back to compiling gcc-2.95.3
i think you should run that compile and install again so everything is ok just overtop of what you did
you are compiling one compiler with another version compiler so there needs to be some extra passes
so the 2.95 is all 2.95 and not just half 2.95 with code from the other compiler in it so after we get it going we ask it to compile itself "bootstrap" twice more and check itself against itself. Also i give you some other configuration options so you get threading and whatnot. (always check ./configure ---help especially if you have some special needs like languages or whatever) i only do for c and c++ which is all i use
there are some common patches to use in doing this and i think for your situation 3.2.1 to 2.95.3
i would use (i really think i have this right for your compiler version just do a fresh untar and start over if this compile fails because of these patches) i don't think the build will work at all without the first one. so go here
http://ftp.nluug.nl/ftp/pub/os/Linux...e-13/blfs.html
and get
gcc-2.95.3-1.patch
and
gcc-2.95.3-no-fixinc.patch
the first one fixes some symbol problems and the second keeps it from trying to rearange glibc headers for itself in it's private directory
now on to the build
from within the gcc directory after you untar it and with the patches in the directory above
Code:
patch -Np1 -i ../gcc-2.95.3-1.patch 
patch -Np1 -i ../gcc-2.95.3-no-fixinc.patch
mkdir ../gcc-build 
cd ../gcc-build
now for the configure -- this is all one command
Code:
../gcc-2.95.3/configure \
--enable-shared --enable-languages=c,c++ \
--enable-threads=posix
now to build and it will take some time
if this fails try
"make bootstrap4" to give it yet another pass (i think -- it's been along time since i had to do that)
Code:
make bootstrap
now as root from here on out
Code:
make install
ln -sf gcc /usr/local/bin/cc
make sure /usr/local/lib is in
/etc/ld.so.conf
and run
ldconfig
as root
and one last thing to make some symlinks
run this to identify the lib name (all one command)
Code:
L=`find /usr/local/lib -name "*libstdc++*.so" -type f` &&
IL=`basename $L`
now make some links so the libs will run some precompiled packages
Code:
ln -sf $IL /usr/local/lib/libstdc++-libc6.1-1.so.2 
ln -sf $IL /usr/local/lib/libstdc++-libc6.2-2.so.3 
ln -sf $IL /usr/local/lib/libstdc++-libc6.3-2.so.3
all done
 
Old 06-29-2005, 12:46 AM   #7
nelnel
Member
 
Registered: May 2005
Posts: 47

Original Poster
Rep: Reputation: 15
thx for foo_bar_foo detail replay!!!

now i will try ur method to do it, but unluck, the link of the patch has broken.....

about the Noth suggestion, i m using RedHat 9.2 , in my part, i only need to do the client programming part. No database server should be installed.s
 
Old 06-29-2005, 01:10 AM   #8
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
drag -- possibly that patch below it
gcc-2.95.3-2.patch
is the older ones replacement is why they took the first one down
i'd try that
it's from 2003-10-05
so it certainly seems to be from the right period or close

i can't find the older one anywhere either -- seems like if was still usefull they would leave it up ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DOWNgrade gcc. How? KDel Linux - Software 25 10-29-2009 01:53 AM
Regarding distribution + kernel version + gcc version + glib version. JCipriani Linux - General 8 04-19-2008 02:54 PM
how can I downgrade Perl version on redhat 9.0 ? rainvory Linux - Software 2 03-04-2004 08:50 PM
gcc downgrade: help required ludwig W Linux - Software 12 03-31-2003 02:09 AM
any recomendations to downgrade GCC 2.96 to 2.95? Hano Linux - Distributions 2 06-09-2002 02:11 PM


All times are GMT -5. The time now is 08:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration