build gcc 5.1 on ubuntu 14.04 x86_64

Table of Contents

host environment

$ uname -a
Linux rms 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:    14.04
Codename:   trusty

build step

download source package

prepare and build

# prepare source
tar xf gcc-5.1.0.tar.bz2
cd gcc-5.1.0/contrib/
./download_prerequisites

# move dependency packages to source root directory
mv isl-0.14 ../isl
mv mpfr-2.4.2 ../mpfr
mv mpc-0.8.1 ../mpc
mv gmp-4.3.2 ../gmp

# do not build in source directory
cd ../..
mkdir build-gcc
cd build-gcc
../gcc-5.1.0/configure --prefix=/usr/local --enable-languages=c,c++ --program-suffix=-5.1 --enable-shared --enable-threads=posix --enable-nls --with-arch-directy=amd64 --enable-multiarch --with-arch-32=i686 --with-abi=m64 --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
make -j4
sudo make install

Author: sanye

Exported At 2021-02-24 Wed 23:51. Created by Emacs 26.1 (Org mode 9.4)