LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   downgrade of GCC version (https://www.linuxquestions.org/questions/linux-software-2/downgrade-of-gcc-version-338221/)

nelnel 06-28-2005 10:22 PM

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

btmiller 06-28-2005 11:22 PM

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.

Noth 06-28-2005 11:39 PM

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.

nelnel 06-29-2005 12:27 AM

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

Noth 06-29-2005 12:30 AM

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.

foo_bar_foo 06-29-2005 12:30 AM

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

nelnel 06-29-2005 12:46 AM

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

foo_bar_foo 06-29-2005 01:10 AM

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 ?


All times are GMT -5. The time now is 11:23 PM.