Recompile GCC-4.3.0

Source: Internet
Author: User
Tags gmp
Recompile the GCC-4.3.0-general Linux technology-Linux programming and kernel information, below is the details to read. GCC is a set of program compilers in Unix, including C, C ++, Fortran77, and Java. Upgrading GCC helps shorten the compilation process and generate more efficient programs, however, the compiled program may be large. the latest version is 4. 3. next we will start to install version 4.3.

First of all, make sure that your Unix environment has the compiling language. The system I use is RedHat AS 4.0 U6.

# Gcc-v
Reading specs from/usr/lib/gcc/i386-redhat-linux/3.4.3/specs
Configured :.. /configure -- prefix =/usr -- mandir =/usr/share/man -- infodir =/usr/share/info -- enable-shared -- enable-threads = posix -- disable-checking -- with-system-zlib -- enable-_ cxa_atexit -- disable-libunwind-exceptions -- enable-java-awt = gtk -- host = i386-redhat-linux
Thread model: posix
Gcc version 3.4.3 20041212 (Red Hat 3.4.3-9. EL4)
Display GCC version information.

The GCC environment can contain no compiler. C, C ++, g77, and Java are installed by default. generally, you need to specify the compilers to upgrade when upgrading GCC and the compiler. This article focuses on the upgrade of C and C ++ compilers, including g95.g95, the latest version of Fortran. In many cases, the source code still calls g77 for compilation.

# Gcc
Gcc: no input files
# C ++
C ++: no input files
# G77
G77: no input files
C, c ++, and g77 are integrated into GCC.

# Java
-Bash: java: command not found
This indicates that it is not installed.

To install GCC, you must first install mpfr and gmp (these two packages are required for the Fortran compiler)
Uninstall first.
# Rpm-qa | grep gmp
Gmp-devel-4.1.4-3
Gmp-4.1.4-3

# Rpm-e -- nodeps gmp-devel-4.1.4-3
# Rpm-e -- nodeps gmp-4.1.4-3

# Wget ftp://ftp.gnu.org/gnu/gmp/gmp-4.2.2.tar.bz2
# Tar jxf gmp-4.2.2.tar.bz2
# Cd gmp-4.2.2
#./Configure -- prefix =/usr -- enable-cxx \
-- Enable-mpbsd
# Make
# Make install

# Wget http://svn.cross-lfs.org/svn/rep... cumulative-1.patch
# Wget http://www.mpfr.org/mpfr-current/mpfr-2.3.1.tar.bz2
# Tar jxf mpfr-2.3.1.tar.bz2
# Cd mpfr-2.3.1
# Patch-Np1-Z-I ../mpfr-2.3.1-cumulative-1.patch
#./Configure -- prefix =/usr -- enable-shared
# Make
# Make install

Install g95
# Wget http://ftp.g95.org/g95-x86-linux.tgz
# Tar zxf g95-x86-linux.tgz
# Cp g95-install/bin/i686-suse-linux-gnu-g95/usr/bin/g95

Next, we will start to install gcc. We do not recommend that you delete the old version of gcc. You just need to point the gcc to a new version. In this way, you can still use the old version of gcc.

# Wget http://ftp.gnu.org/gnu/gcc/gcc-4.3.0/gcc-4.3.0.tar.bz2
# Tar jxf gcc-4.3.0.tar.bz2
# Cd gcc-4.3.0
# Sed-I's/install_to _ $ (INSTALL_DEST) // 'liberty/Makefile. in
# Mkdir-v ../gcc-build
# Cd ../gcc-build
# ../Gcc-4.3.0/configure -- prefix =/usr \
-- Libdir =/usr/lib \
-- Libexecdir =/usr/lib \
-- Enable-shared \
-- Enable-threads = posix \
-- Enable-_ cxa_atexit \
Enable-c99 \
-- Enable-long \
-- Enable-clocale = gnu \
-- Disable-libstdcxx-pch \
-- Disable-multilib \
-- Enable-languages ages = c, c ++, f95

If you add a language named make in -- enable-languages ages =, an error is returned.

# Make bootstrap
# Make-k check
# ../Gcc-4.3.0/contrib/test_summary
# Make install
# Ln-sfv ../usr/bin/cpp/lib
# Ln-sfv gcc/usr/bin/cc
# Chown-Rv root: root/usr/lib/gcc/$ (gcc-dumpmachine)/4.3.0/include
# Ln-sfv 'Find/usr/lib/gcc-name ffitarget. H'/usr/include

View gcc
# Gcc-v
[Root @ mailserver ~] # Gcc-v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured :.. /gcc-4.3.0/configure -- prefix =/usr -- libdir =/usr/lib -- libexecdir =/usr/lib -- enable-shared -- enable-threads = posix -- enable-_ cxa_atexit -- enable-c99 -- enable-long -- enable-clocale = gnu -- disable-libstdcxx-pch -- disable-multilib -- enable-versions ages = c, c ++, f95
Thread model: posix
Gcc version 4.3.0 (GCC)
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.