Install arm-linux-gcc-4.4.3.tar.gz under Ubuntu (cross-compilation environment) __linux

Source: Internet
Author: User
Test the achievements of predecessors, combined with their own practice, arm-linux-gcc-4.4.3.tar.gz download Address: http://ishare.iask.sina.com.cn/f/13836544.html?from=like

I use the system is Ubuntu12.04, but as long as Ubuntu should be able to install this step.

1. Extract Files

Extract the Tar zxvf arm-linux-gcc-4.4.3.tar.gz-c/(directly after decompression,-c/will let the extracted files automatically placed in the root directory specified path, without pipe)
Download arm-linux-gcc-4.4.3.tgz to any directory, enter this folder

sudo tar xvzf arm-linux-gcc-4.4.3.tgz–c/

Note: c is followed by a space (not required), and C is uppercase (must), it is the English word "change" the first letter, here is the meaning of changing the table of contents. By executing this command, the ARM-LINUX-GCC will be installed to the/opt/friendlyarm/toolschain/4.4.3 directory.

2. Create a catalogue

sudo mkdir/usr/local/arm

3. Copy files

sudo cp-r/opt/friendlyarm/toolschain/4.4.3/usr/local/arm

5. Add Environment variables

Many ways to modify environment variables on the web are miscellaneous. There are redhat above, fedora. Here are a total of three methods, some people have tried on the UBUNTU11.10, feasible. (I have only used the first method, the others have not tried)

Method One: Modify the/ETC/BASH.BASHRC file (this file applies only to the current user)
sudo gedit/etc/bash.bashrc
At the end add the export path= $PATH:/opt/friendlyarm/toolschain/4.4.3/bin (note that there are no spaces on the equals sign)

Method Two: Modify the/etc/profile file (this file is a system-level environment variable, set inside the thing for all users)
sudo gedit/etc/profile
Add the path setting, adding the following at the end:
Export path= $PATH:/usr/local/arm/4.4.3/bin

Method Three: Modify the/etc/environment file
sudo gedit/etc/environment
The original file should be
Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
Change it to
Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/arm/4.4.3/bin"

Questions about environment variables:

What the environment variable is. For example, path, when the system is asked to run a program without telling it the full path of the program, the system, in addition to looking for the program under the current directory, should also go to the path specified in paths to find. Users to better run the process by setting the environment variables.
If the above does not add environment variables, to run ARM-LINUX-GCC this program, each time to arm-linux-gcc the full path to write out. /usr/local/arm/4.4.3/bin ARM-LINUX-GCC filename-o output file name
This is very troublesome, so add it to the path and let the computer know where the program is.

6. Register environment variable (This step is not done, step 8 also shows successful installation)

Immediately make the new environment variable effective, without restarting the computer, there are 3 methods for step 5
Method One: SOURCE/ROOT/.BASHRC
Or
./ETC/BASH.BASHRC
Method Two: Source/etc/profile
Method III: Immediate effect

7. Check to see if the path is joined to path (this step is not done, step 8 also shows successful installation)

Echo $PATH
Display Content/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/arm/4.4.3/bin Indicates that the path to the cross compiler has been added. At this point, the cross compilation environment installation is complete.

8. Test whether the installation was successful

Method One: Open another terminal, enter arm-, and then press TAB, if the following information appears, the installation is successful
ARM2HPDL arm-linux-gprof
Arm-elf-addr2line Arm-linux-ld
Arm-elf-ar arm-linux-nm
Arm-elf-as arm-linux-objcopy
Arm-elf-c++ Arm-linux-objdump
Arm-elf-c++filt arm-linux-populate
Arm-elf-elf2flt Arm-linux-ranlib
ARM-ELF-FLTHDR arm-linux-readelf
arm-elf-g++ arm-linux-size
ARM-ELF-GCC arm-linux-strings
Arm-elf-ld

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.