"Go" compile and install gcc 4.8.1 + GDB 7.6.1 in CentOS 6.4

Source: Internet
Author: User

Compile and install gcc 4.8.1 + GDB 7.6.1 in CentOS 6.4

First, compile and install GCC 4.8.1

1. Installing GCC and g++

The newly installed CentOS is missing the compilation environment and the old version of GCC must be installed before the bootstrap compilation

Yum-y Install GCC
Yum-y Install gcc-c++

2. Download gcc 4.8.1 source Package

Http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-4.8.1/gcc-4.8.1.tar.gz

Place the source bundle in the download directory in the home directory

3. Unzip the GCC 4.8.1 source package

cd/root/downloads/

TAR-ZXVF gcc-4.8.1.tar.gz

4. Download the dependent packages required for compilation

cd/root/downloads/gcc-4.8.1

./contrib/download_prerequisites

Cd..

5. Create a new directory to hold compilation results

mkdir gcc-build-4.8.1

6. Enter the new directory and execute the Configure command to generate the makefile

CD gcc-build-4.8.1
.. /gcc-4.8.1/configure--enable-checking=release--enable-languages=c,c++--disable-multilib

7. Compiling GCC 4.8.1

Make-j4

8. Installing GCC 4.8.1

sudo make install

9. Update libstdc++.so.6

sudo cp/root/downloads/gcc-build-4.8.1/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.18 /usr/lib
sudo ln-sf/usr/lib/libstdc++.so.6.0.18/usr/lib/libstdc++.so.6

The Scarlet Letter section differs on different platforms, note that if it is a 64-bit system, the Lib in the command is replaced with lib64

10. Check the version

g++--version

g++ (GCC) 4.8.1
Copyright (C) Free Software Foundation, Inc.
This was free software;  See the source for copying conditions. There is NO
Warranty Not even to merchantability or FITNESS for A particular PURPOSE.

GCC--version

GCC (GCC) 4.8.1
Copyright (C) Free Software Foundation, Inc.
This was free software;  See the source for copying conditions. There is NO
Warranty Not even to merchantability or FITNESS for A particular PURPOSE.

Ii. compiling and installing GDB 7.6.1

1. Uninstall the old GDB version first

Rpm-qa | grep gdb

RPM-E--nodeps gdb-7.2-60.el6_4.1.i686

2. Installing the Texinfo Documentation system

Yum Install Ncurses-devel

3. Download GDB 7.6.1 Source Package

Http://ftp.gnu.org/gnu/gdb/gdb-7.6.1.tar.gz

Place the source bundle in the download directory in the home directory

4. Unzip the GDB 7.6.1 source package

cd/root/downloads/

TAR-ZXVF gdb-7.6.1.tar.gz

5. Generate makefile

cd/root/downloads/gdb-7.6.1

./configure

Make

sudo make install

6. Copy the compiled gdb to the/usr/bin directory
sudo cp/root/downloads/gdb-7.6.1/gdb/gdb/usr/bin/gdb
7. See if the installation was successful.
Gdb-v


"Go" compile and install gcc 4.8.1 + GDB 7.6.1 in CentOS 6.4

Related Article

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.