Virtual Private Servers | Virtuozzo VPS | Dedicated Servers

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Installing Older Gcc Version, Installing older gcc version
fgeck
post Jul 27 2004, 09:28 AM
Post #1


Member


Group: Members
Posts: 2
Joined: 26-July 04
Member No.: 28,640



How in the world do you install an older version of gcc? ie.. 2.96 when 3.2.3 is installed? Don't ask why just have too do it as the 2.4.21 kerenel will not compile with 3.2.3 it seems.

roblem with reverting back is that there are so many depenanceys between packages even when using --oldpackage on rpm youget errors.

Thanks

Frank
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
jools
post Jul 27 2004, 12:27 PM
Post #2


Linux Freak
**********

Group: Members
Posts: 369
Joined: 12-February 04
Member No.: 12,032



When you build linux with the linux from scratch instructions, you install two compilers - one for the 2.4..x kernel.
Here's a link to the instructions from the
stable blfs
2.95.3 is the recommended version for building the 2.4.x kernel.
It gets installed with the prefix /opt/gcc-2.95.3 - so all its files go into subdirectories of /opt/gcc-2.95.3, such as /opt/gcc-2.95.3/lib /opt/gcc-2.95.3/bin etc..., so they wont mess up your files.
The patches mentioned are probably specific to LFS, so you don't need them.

I would do (as root)

mkdir ~/gcc_download
cd ~/gcc_download
wget http://ftp.gnu.org/gnu/gcc/gcc-2.95.3.tar.gz
tar -zxvf gcc-2.95.3.tar.gz
cd gcc-2.95.3
mkdir ../gcc-build
cd ../gcc-build
../gcc-2.95.3/configure \
--prefix=/opt/gcc-2.95.3 \
--enable-shared --enable-languages=c,c++ \
--enable-threads=posix


stop and check the ./configure step worked

make bootstrap &&
make install


if you are not root, make install will fail - just rerun it as root.
do the clever bit from the LFS instructions:

L=`find /opt/gcc-2.95.3/lib -name "*libstdc++*.so"` &&
IL=`basename $L`
for i in /opt/gcc-2.95.3/lib/*.so*; do mv -f $i /usr/lib;
ln -sf /usr/lib/`basename $i` /opt/gcc-2.95.3/lib; done
ln -sf $IL /usr/lib/libstdc++-libc6.1-1.so.2 &&
ln -sf $IL /usr/lib/libstdc++-libc6.2-2.so.3 &&
ln -sf $IL /usr/lib/libstdc++-libc6.3-2.so.3 &&
ldconfig


check the new gcc works:
/opt/gcc-2.95.3/bin/gcc -v
output:
Reading specs from /opt/gcc-2.95.3/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/specs
gcc version 2.95.3 20010315 (release)

when you get to compile your kernel you just change the usual steps slightly, e.g.:
make CC=/opt/gcc-2.95.3/bin/gcc dep
make CC=/opt/gcc-2.95.3/bin/gcc bzImage
make CC=/opt/gcc-2.95.3/bin/gcc modules
make CC=/opt/gcc-2.95.3/bin/gcc modules_install

- you get the idea

oh and any kernel modules will need to be compiled with the same gcc as the kernel.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 



Lo-Fi Version Time is now: 11th February 2006 - 02:01 AM