From subsecret
Revision as of 11:21, 21 April 2013 by Steffen Mikkelsen (talk | contribs) (Created page with "==libelf== tar xf libelf-0.8.13.tar.gz cd libelf-0.8.13 ./configure --prefix=/tools/ make -j 12 make install cd .. ==GMP== tar xf gmp-5.0.1.tar.gz cd gmp-5.0.1 ./c...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

libelf

tar xf libelf-0.8.13.tar.gz
cd libelf-0.8.13
./configure --prefix=/tools/
make -j 12
make install
cd ..

GMP

tar xf gmp-5.0.1.tar.gz
cd gmp-5.0.1
./configure --prefix=/tools/
make -j 12
make install
cd ..

MPFR

tar xf mpfr-3.0.0.tar.gz
cd mpfr-3.0.0
./configure --with-gmp=/tools --prefix=/tools/
make -j 12 install
cd ..

MPC

tar xf mpc-0.9.tar.gz
cd mpc-0.9
./configure --with-gmp=/tools --with-mpfr=/tools --prefix=/tools/
make -j 12
make install
cd .. 

GCC

Now we change dynamic linker variable for compiling GCC with right version of libraries.

export LD_LIBRARY_PATH=/tools/lib
tar xf gcc-4.5.2.tar.bz2 
cd gcc-4.5.2

Go to gcc/config/i386 and edit linux64.h or linux.h.

#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"

Is changed to:

#define GLIBC_DYNAMIC_LINKER32 "/tools/lib/ld-linux.so.2"
#define GLIBC_DYNAMIC_LINKER64 "/tools/lib/ld-linux-x86-64.so.2"
cd ..
mkdir gccbuild
cd gccbuild
../gcc-4.5.2/configure --disable-multilib --with-mpfr=/tools --with-gmp=/tools --with-mpc=/tools --prefix=/tools/ --enable-languages=c,c++
make -j 12 
make install
cd ..
ln -s /tools/bin/gcc /tools/bin/cc

We are now ready for next step