Build cross-compiler environment in Linux 14.04lts environment arm-linux-gcc-4.5.1

Source: Internet
Author: User

The cross-compilation toolchain is designed to compile, link, process, and debug program code for cross-platform architectures in which the operating system, applications, and so on embedded Linux systems are compiled and uploaded to the target board.

First of all to clarify the difference between GCC and ARM-LINUX-GCC, GCC is the C language compiler of the x86 architecture, the compiled program is executed locally, and ARM-LINUX-GCC is a cross-platform C language compiler, the compiled program is executed in the target class, Embedded development should use the cross-compiler toolchain, below gives the detailed Linux 14.04lts environment to build the cross-compilation environment arm-linux-gcc-4.5.1 installation steps:

Figure 1

Figure 2

Figure 3

1, for example, into the directory where the compressed package is located, the downloaded arm-linux-gcc-4.5.1-v6-vfp-20120301.tgz placed under the/home/arm/path, enter the command: sudo tar Xvzfarm-linux-gcc-4.5.1-v6-vfp-20120301.tgz, after the installation is complete, enter the LS command, you can see an opt folder;

2, modify the environment variables, add the path of the cross compiler to path: Use the TAB key to enter the path, enter the PWD command, view the absolute path of the current path/home/hemingway/arm/opt/friendlyarm/toolschain/ 4.5.1/bin, notice the name of the household Hemingway;

3, then enter the following command: SUDOGEDIT/ETC/BASH.BASHRC, then add the following three lines of code in the Open text:

if [-d/home/hemingway/arm/opt/friendlyarm/toolschain/4.5.1]; Then

Path=/home/hemingway/arm/opt/friendlyarm/toolschain/4.5.1/bin: "${path}"

FI, see;

Figure 4

Figure 5

4. Then use the command SOURCE/ETC/BASH.BASHRC to make the environment variable effective;

5, check whether the path is added to path: Next use the command echo $PATH to see if the environment variable is added successfully, if the environment variable appears in the path just added to succeed, see Figure 5;

6, test whether the installation is successful, the ARM-LINUX-GCC-V input command will display ARM-LINUX-GCC information and version, as shown in Figure 5 above, indicating that the program was successfully installed.

Build cross-compiler environment in Linux 14.04lts environment arm-linux-gcc-4.5.1

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.