Upgrade gcc with rpm package for redhat

Source: Internet
Author: User
When I compile kgdb earlier, due to Kernel configuration (For details, refer to my blog article "build kgdb on vmware to debug the linuxkernel source code platform, therefore, I initially suspected that the gcc version on RedHat was too low (3.2.2. After the Gcc version is upgraded to 3.4.6, it is not because of the version. In this case, the gcc rpm upgrade method is implemented. Here we will share with you the rpm method of gcc upgrade: 1. Download gcc3 and compile kgdb in front of it, due to kernel configuration (For details, refer to my blog "build kgdb to debug linux kernel source code platform on vmware, therefore, I initially suspected that the gcc version on RedHat was too low (3.2.2. After the Gcc version is upgraded to 3.4.6, it is not because of the version. In this case, the gcc rpm upgrade method is implemented. Here we will share with you the rpm method of gcc upgrade:

1. Download the rpm package for gcc3.4.6
Bytes. The RPM package to be downloaded is as follows:

Cpp-3.4.6-8.i386.rpm
Gcc-3.4.6-8.i386.rpm
Glibc-2.3.4-2.36.i386.rpm
Glibc-common-2.3.4-2.36.i386.rpm
Glibc-devel-2.3.4-2.36.i386.rpm
Glibc-headers-2.3.4-2.36.i386.rpm
Glibc-kernheaders-2.4-9.1.100.EL.i386.rpm

2. Download the source code package of the binutils version required by gcc3.4.6.
Bytes.

3. Compile and install binutils-2.15.tar.bz2
# Tar jvxf binutils-2.15.tar.bz2
# Cd binutils-2.15.
#./Configure
# Make
# Make install
# Ld-v

GNU ld version 2.15

Have you seen this? Our binutils has been successfully upgraded to version 2.15.

4. Install the rpm package

The installation sequence and command are as follows:
# Rpm-Uvh --- nodeps --- replacefiles glibc-kernheaders-2.4-9.1.100.EL.i386.rpm
# Rpm-Uvh --- nodeps --- replacefiles glibc-common-2.3.4-2.36.i386.rpm
# Rpm-Uvh --- nodeps --- replacefiles glibc-headers-2.3.4-2.36.i386.rpm
# Rpm-Uvh --- nodeps --- replacefiles glibc-devel-2.3.4-2.36.i386.rpm
# Rpm-Uvh --- nodeps --- replacefiles glibc-2.3.4-2.36.i386.rpm
# Rpm-Uvh --- nodeps --- replacefiles cpp-3.4.6-8.i386.rpm
# Rpm-Uvh --- nodeps --- replacefiles gcc-3.4.6-8.i386.rpm

After the installation is complete, run the command to view the relevant version.

# Gcc --- version/* view gcc version */
#/Lib/libc. so.6/* view the glibc version */

At this time, I wrote a simple hello. c file for compilation and found that the stdio. h file could not be found. Fainted, at this time I re-installed the glibc-headers-2.3.4-2.36.i386.rpm once. Recompile hello. c and Linux kernel. All are successful. As to why you finally need to re-install the glibc-headers-2.3.4-2.36.i386.rpm, it may be that the installation order of the previous rpm package is wrong. I have no further details. This is because I went straight to kgdb.
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.