GCC Source code compilation

Source: Internet
Author: User
Tags gmp

1. GCC Source code Download

ftp://gcc.gnu.org/pub/gcc/releases/

[[Email protected] ~] wget ftp://gcc.gnu.org/pub/gcc/releases/gcc-8.2.0/gcc-8.2.0.tar.gz[[email protected] ~] Tar zxvf Gcc-8.2.0.tar.gz

Download the GCC version you need.

2. Download the GCC dependent Library source code

GMP FTP://GCC.GNU.ORG/PUB/GCC/INFRASTRUCTURE/GMP-6.1.0.TAR.BZ2

MPC ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz

MPFR ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2

[[email protected] ~] wget ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2 ftp://gcc.gnu.org/pub/ Gcc/infrastructure/mpc-1.0.3.tar.gz ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2[[email  Protected] ~] Tar jxvf gmp-6.1.0.tar.bz2[[email protected] ~] Tar zxvf mpc-1.0.3.tar.gz[[email protected] ~] Tar jxvf mpfr-3.1.4.tar.bz2[[email protected] ~] CD ~/gmp-6.1.0[[email protected] ~./configure--prefix=/ Usr/local/gmp[[email protected] ~] Make && make install[[email protected] ~] CD ~/mpc-1.0.3[[email& Nbsp;protected] ~]./configure--prefix=/usr/local/mpc[[email protected] ~] Make && make install[[email& Nbsp;protected] ~] CD ~/mpfr-3.1.4[[email protected] ~]./configure--prefix=/usr/local/mpfr[[email  Protected] ~ [Make && make install[[email protected] ~] Export ld_library_path= $LD _library_path:/usr/ Local/mpc/lib:/usr/local/gmp/lib:/usr/local/mpfr/lib/[[email protected] ~] CD ~/Gcc-8.2.0[[email protected] ~]./configure--PREFIX=/USR/LOCAL/GCC--with-gmp=/usr/local/gmp/--with-mpfr=/usr /local/mpfr/--with-mpc=/usr/local/mpc/--with-system-zlib--disable-multilib[[email protected] ~] Make & & Make Install

 3. Note

make encountered:
checking for  suffix of object files... configure: error: in  '/home/yhwang/gcc-8.2/ GCC-8.2.0/X86_64-LINUX-GNU/LIBGCC ':
configure: error: cannot  compute suffix of object files: cannot compile
see  ' Config.log '  for more details.
make[2]: *** [configure-stage1-target-libgcc]  error  1
make[2]: Leaving directory   '/home/yhwang/gcc-8.2/gcc-8.2.0 '
make[1]: *** [stage1-bubble]  error  2
make[1]: Leaving directory   '/home/yhwang/gcc-8.2/gcc-8.2.0 '
make: *** [all]  Error  2

And then you stop, you need to enter the following statement before compiling

[[Email protected] ~] Export ld_library_path= $LD _library_path:/usr/local/mpc/lib:/usr/local/gmp/lib:/usr/local/ mpfr/lib/

And then

[[Email protected] ~] Make && make install

4. Check the GCC version

[[Email protected] ~] Gcc-v[[email protected] ~] g++-V

GCC Source code compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.