1. DownloadSource code
Wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.0/gcc-4.8.0.tar.bz2
2. Extract
Tar-jxvf gcc-4.8.0.tar.bz2
3. Download the dependencies required for compilation.
CD gcc-4.8.0./contrib/download_prerequisites CD ..
4. Create a compilation output directory
Mkdir gcc-build-4.8.0
5. Go to the directory and run the following command to generate the MAKEFILE file.
CD gcc-build-4.8.0 ../gcc-4.8.0/configure -- enable-checking = release -- enable-extensions ages = C, C ++ -- disable-multilib
6. Execute the following command to compile
Make-J4
So far, the compilation process has been completed. Wait until the compilation is completed ....
During compilation, the CPU runs at full capacity. About 40 minutes.
7. Install
Sudo make install
8. Check the GCC version.
GCC -- version
[Arlen @ Arlen-centos gcc-build-4.8.0] $ GCC -- versiongcc (GCC) 4.8.0copyright 2013 Free Software Foundation, Inc.ProgramIs Free Software. See the sourceCode. This software does not have any warranty, including non-marketable and non-applicable warranties for a specific purpose. [Arlen @ Arlen-centos gcc-build-4.8.0] $