How to install GCC 4.1.2 on Linux

Source: Internet
Author: User

Installation steps:
1. First download the GCC 4.1.2 Source code package:

wget http://mirrors.ustc.edu.cn/gnu/gcc/gcc-4.1.2/gcc-4.1.2.tar.bz2

2. Decompression:

Bzcat gcc-4.1. 2. Tar Tar xvf-

3. Create Destdir:

mkdir /usr/local/gcc-4.1. 2  /usr/local/gcc-4.1. 2

4. Configuration:

$/home/esms/downloads/gcc-4.1. 2/configure--prefix=/usr/local/gcc-4.1. 2 --enable-threads=posix--disable-checking--enable--Long-long --host= I386-redhat-linux--with-system-zlib--enable-languages=c,c++,java

5. Compiling:

Make

This process will often encounter problems, the actual machine type, the environment is very different, can only see a solution one:

1)/USR/BIN/LD:BFD 2.14.90.0.4 20030523 Internal error, aborting at.. /.. /BFD/ELF32-I386.C Line 2377 in Elf_i386_relocate_section
Workaround: First look at this article http://gcc.gnu.org/ml/gcc-help/2006-07/msg00043.html, probably because the binutils version is too low, so I would like to upgrade the next binutils:

wget FTP://ftp.kernel.org/pub/linux/devel/binutils/binutils-2.16.91.0.3.tar.gz

See this article to learn how to install: http://www.linuxfromscratch.org/lfs/view/6.2/chapter06/binutils.html

mkdir -V. /binutils-build $ cd . /binutils-build $.. /binutils-2.16. 91.0. 3/configure--prefix=/usr--enable- make tooldir=/  make  Make Install  CP -v. /binutils-2.16. 91.0. 3

Then re-execute make.

6. Installation:

 Make Install

7, modify the shortcut:

$ cd/usr/Bin $MV GCCgcc323 $LN-s/usr/local/GCC-4.1.2/bin/GCC GCC $ MVg++ g++323 $ LN-s/usr/local/GCC-4.1.2/bin/g++ g++ $ MVGCJ gcj323 $LN-s/usr/local/GCC-4.1.2/BIN/GCJ GCJ

8, complete.

References:
1, User CHUNCN's Chinese Installation Guide: http://www.cnblogs.com/chuncn/archive/2010/10/15/1851853.html
2, GCC Installation instructions for 4.1.2 after decompression (English): gcc-4.1.2/install/index.html

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.