Reference to the achievements of predecessors, combined with their own practice, arm-linux-gcc-4.4.3.tar.gz:
Http://ishare.iask.sina.com.cn/f/13836544.html?from=like
I use the system is Ubuntu12.04, but as long as the Ubuntu should be able to install this step.
1. Extracting files
Unzip the tar zxvf arm-linux-gcc-4.4.3.tar.gz-c/(
directly after the decompression can be,-c/will let the extracted files automatically placed in the root directory specified path, no tube)
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 directory. Executing this command will install the ARM-LINUX-GCC into the/opt/friendlyarm/toolschain/4.4.3 directory.
2. Create a directory
sudo mkdir/usr/local/arm
3. Copying 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 Internet are very miscellaneous. There's redhat above, fedora. Here are three ways, some people have tried on the UBUNTU11.10, feasible. (I only used the first method, the others did not try)
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 export path= $PATH:/opt/friendlyarm/toolschain/4.4.3/bin (the path) (note that there is no space on the equal sign)
Method Two: Modify the/etc/profile file (this file belongs to the system level environment variable, the thing that is set inside is applicable to all users)
sudo gedit/etc/profile
Add the path setting, at the end, as follows:
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"
about environment variable issues:
What are environment variables? For example, path, when the system is required to run a program without telling it the full path of the program, in addition to the current directory under the search for this program, but also to the path specified in the paths to find. The user can run the process better by setting the environment variables.
If the above does not add environment variables, to run ARM-LINUX-GCC this program, each time you have to write the full path of ARM-LINUX-GCC. /USR/LOCAL/ARM/4.4.3/BINARM-LINUX-GCC file name-o output file name
This is very troublesome, so add to path and let the computer know where the program is.
6. Register Environment variables (This step is not done, step 8 also shows that the installation was successful)
immediately make the new environment variable effective, do not restart the computer, corresponding to step 5 there are 3 ways
method One: SOURCE/ROOT/.BASHRC
or
./ETC/BASH.BASHRC
method Two: Source/etc/profile
method Three: Immediate effect
7. Check if the path is added to path (this step is not done, step 8 also shows that the installation was successful)
Echo $PATH
Display Content/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/arm/4.4.3/ The bin description has joined the path of the cross compiler. At this point, the cross-compilation environment is installed.
8. Test whether the installation is successful
method One: Open another terminal, enter arm-, and then press TAB twice, 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 Arm-linux-strip
arm-elf-ld.real Arm-none-linux-gnueabi-addr2line
arm-elf-nm Arm-none-linux-gnueabi-ar
arm-elf-objcopy Arm-none-linux-gnueabi-as
arm-elf-objdump arm-none-linux-gnueabi-c++
arm-elf-protoize arm-none-linux-gnueabi-cc
arm-elf-ranlib arm-none-linux-gnueabi-c++filt
arm-elf-readelf arm-none-linux-gnueabi-cpp
arm-elf-size Arm-none-linux-gnueabi-ct-ng.config
arm-elf-strings arm-none-linux-gnueabi-g++
Arm-elf-strip ARM-NONE-LINUX-GNUEABI-GCC
arm-elf-unprotoize arm-none-linux-gnueabi-gcc-4.4.3
Arm-linux-addr2line Arm-none-linux-gnueabi-gccbug
--more--
method Two: Enter ARM-LINUX-GCC-V in the terminal, this command will display ARM-LINUX-GCC information and version, if the following message indicates the installation is successful
Using built-in specs.
Target:arm-none-linux-gnueabi
configured with:/opt/friendlyarm/mini2440/build-toolschain/working/src/gcc-4.4.3/configure--build= I386-build_redhat-linux-gnu--host=i386-build_redhat-linux-gnu--target=arm-none-linux-gnueabi--prefix=/opt/ friendlyarm/toolschain/4.4.3--with-sysroot=/opt/friendlyarm/toolschain/4.4.3/arm-none-linux-gnueabi// sys-root--enable-languages=c,c++--disable-multilib--with-arch=armv4t--with-cpu=arm920t--with-tune=arm920t-- with-float=soft--with-pkgversion=ctng-1.6.1--disable-sjlj-exceptions--enable-__cxa_atexit--with-gmp=/opt/ friendlyarm/toolschain/4.4.3--with-mpfr=/opt/friendlyarm/toolschain/4.4.3--with-ppl=/opt/friendlyarm/ toolschain/4.4.3--with-cloog=/opt/friendlyarm/toolschain/4.4.3--with-mpc=/opt/friendlyarm/toolschain/4.4.3-- WITH-LOCAL-PREFIX=/OPT/FRIENDLYARM/TOOLSCHAIN/4.4.3/ARM-NONE-LINUX-GNUEABI//SYS-ROOT--DISABLE-NLS-- Enable-threads=posix--enable-symvers=gnu--enable-c99--enable-long-long--enable-target-optspace
Thread Model:posix
gcc version 4.4.3 (ctng-1.6.1)
at this point, the installation is complete!
Notes Install arm-linux-gcc-4.4.3.tar.gz under Ubuntu (cross-compilation environment)