linux in ARM cross compiler installed

1. Download arm-linux-gcc compiler.

2. Download the good compiler compressed copy the files to the linux. Be careful not to unpack in the windows, because the RAR decompression tool decompress gzip compressed file compression tool may be a problem.

Try to place the compiler compressed file to the root folder (in fact not necessarily to the root folder. But I found a course provided by the manufacturer of the compiler is not installed in the specified location, the compiler prompts library Can not find), the aim is to minimize trouble.

After the copy is good, in the end-use:

# tar xvzf arm-linux-gcc-4.4.3.tar.gz

Decompression compiler.

3. Extract after a good rest on only a step change environment variables.

Because even though we have the compiler decompression in step 2 well. That some of the tools of the compiler has been on our linux, but the system does not know this compiler already exists, and we use the compiler command when the system does not know where to find these compilation tools.

Changes in the environment variable can change three files:

(1) In the first input terminal

# cd

Into the current user's home folder. Then the input terminal

# Vi .bashrc

Then at the end of the file added: export PATH = $ PATH: After /opt/toolschain/4.4.3/bin (path here is the installation path compiler), good save changes.

Enter in a terminal:

# Source .bashrc // let the altered environment variables to take effect

# Arm-linux-gcc -v // test output of the compiler version number, assuming a successful installation, the compiler will output the correct version number

Note:. .Bashrc - The individual per-interactive-shell startup file this file is mainly to save some personal personalized settings. The alias command, paths.

That is on the same server, only relevant to a user's personalized settings.

linux is a multi-user operating system, each user's environment variables may be different (with a common part, also has its own private part), change the file. Only affect the current user's environment variables.

(2) change / etc / profile

# sudo vi /etc/profile

Then at the end of the file added: export PATH = $ PATH: /opt/toolschain/4.4.3/bin, then save the changes well.

# source /etc/profile

# arm-linux-gcc -v

Note: etc folder file is a profile of each user login, Caozuojitong first run the file, and then .profile file control to the user's home folder, when the main system is given prompt ($ PS1 after), users will be able to begin their work.

All of the above process is transparent to the user.

(3) changes /etc/bash.bashrc

# South you /etc/bash.bashrc

Compiled path and save it.

# source /etc/bash.bashrc

# arm-linux-gcc -v

Note: This file settings will take effect globally.

 

Summary: In fact, I own testing purposes change the current .profile file in the user home folder is also able to achieve changes in the environment variable. As the scope / etc / profile file that all users, so the non-common settings should be placed on the user's own .profile file. The original .profile files are used by system administrators Sysadmsh command or mkdev user command to create the user, the system generated for the user's own initiative, users can use vi to edit the file for their own use. After the utility until the user .profile files generated exit the system disappeared, and when users log on again, began to play a role.

Guess you like

Origin www.cnblogs.com/mqxnongmin/p/10926729.html