Gcc-4.1.0 with gdb6.5 Installation

Source: Internet
Author: User

One install gcc-4.1.0

In RedHat 9.0, an error occurred while compiling the library gcc-3.2.2 with a libusb-0.9.3, not supported for GCC extensions:-wno-pointer-sign and-fvisibility = hidden, instead of the Cross Compiler arm-linux-gcc3.4.1 that can be compiled through. To completely solve the problem, we decided to upgrade GCC.

1 download gcc4.1.0.tar.bz2
# Tar jxf gcc-4.1.0.tar.bz2
In the decompressed Folder/gcc-4.1.0/install has a detailed installation instructions, but said very wordy, installation only need to specify the path, running 'configure 'in the source code tree is unnecessary and bad. A good 'makefile' generated by 'configure 'can build a software package whose source code belongs to another tree. the benefit of constructing a derived file in a tree independent of the source code is obvious: derived files, such as the target file, will be scattered in the source code tree in disorder. this makes it very difficult to build the same target file on another system or with different configuration options. we recommend that you use three trees: A source tree, a build tree, and an install tree )., the method is to compile in the New Folder:
# Mkdir gcc-build // gcc-build and gcc-4.1.0 are in the same folder
# Cd gcc-build

2 Installation
Compile and install the gcc-4.1.0 to/usr/local/gcc-4.1.0 to continue using gcc3.2.2:
# ../Gcc-4.1.0/configure -- prefix =/usr/local/gcc-4.1.0 & make install
......
Waiting for nearly 1 hour

3 settings
The installation path of gcc3.2.2 is/usr/bin. Change the name of GCC, G ++, and gcj in this folder.
# Mv GCC gcc322
# Mv g ++ 322
# Mv gcj gcj322
Reconnect to GCC, G ++, and gcj
# Ln-S/usr/local/gcc4.1.0/GCC gcc
# Ln-S/usr/local/gcc4.1.0/g ++
# Ln-S/usr/local/gcc4.1.0/gcj

4. Add the library path
Add the GCC library path to the environment variable and add it to/etc/profile:
Export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/usr/local/gcc4.1.0/lib

5. Delete gcc-build

2. Install gdb6.5
Gcc-build contains files generated during gcc4.1.0 compilation. After GCC is installed successfully, you can delete the files directly.

The system installed GDB Version 5.3 is not fully compatible with executable files compiled in gcc4.1.0. The print command can only display the global variable value, but cannot display the local variable value. After being upgraded to gdb6.5, the problem is solved.

The method is the same as above.
1 download gdb-6.5.tar.bz2
# Tar jxf gdb-6.5.tar.bz2

# Mkdir GDB-build

2 Installation

# ../Gdb-6.5/configure -- prefix =/usr/local/gdb-6.5 & make install

3 settings

# Cd/usr/bin

# Mv GDB gdb5.3

# Ln-S/usr/local/The gdb-6.5/bin/GDB

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.