The establishment of arm-linux-gcc-3.3.2 Cross Compiler
Source: Internet
Author: User
The establishment of arm-linux-gcc-3.3.2 cross compiler-Linux general technology-Linux programming and kernel information, the following is a detailed reading. 1: Download arm-linux-gcc-3.3.2.tar.bz2 to any directory
I downloaded it to my tools Folder/home/zt/tools
The arm-linux-gcc-3.3.2.tar.bz2 is as follows :( there are 71.3 M)
Go to the tool directory (depending on the situation)
Debian:/home/zt/tools # cd/home/zt/tools
Extract
Debian:/home/zt/tools # tar xvf arm-linux-gcc-3.3.2.tar.bz2
The decompression process takes some time. The decompressed file forms the usr/local/folder.
Enter this folder
Debian:/home/zt/tools # cd usr/local/
Test the arm folder under/usr/local /.
Debian:/home/zt/tools/usr/local # cp-rv arm/usr/local/
Currently, the cross-compiled Assembly is located under/usr/local/arm/3.3.2/bin.
3. Modify Environment Variables
Export PATH =/usr/local/arm/3.3.2/bin: $ PATH
Environment variables added using this method will be lost after power loss. Therefore, you can perform the following operations in the startup script:
Debian:/home/zt/tools/usr/local # vim/etc/bash. bashrc
Add the above command in the last line of the file
Export PATH =/usr/local/arm/3.3.2/bin: $ PATH
Save and exit. When you log on to the root again, the new environment variables will be loaded.
Check
This step is followed by the above steps, I encountered a problem: After restarting, execute echo $ PATH, but the list still does not contain/usr/local/arm/3.3.2/bin! So I tried to add "export PATH =/usr/local/arm/3.3.2/bin: $ PATH" to/home/jx /. in the bash_profile file, restart and run echo $ PATH again./usr/local/arm/3.3.2/bin is displayed in the list. Then, run echo $ PATH in root, and/usr/local/arm/3.3.2/bin is displayed in the list. When I add a jinxin user and then execute "su-l jinxin" (parameter-l indicates logon and change to the user environment to be switched), enter the login password of jinxin, then run echo $ PATH. the/usr/local/arm/3.3.2/bin is not displayed in the list. Data Query: all user environment variables are stored in/. bash_profile (if bash is used). Each user directory is invisible to other users. This statement is also verified above.
Note: I just found a command on the Internet: After modifying the. bash_profile file, run this command directly to make the change of the Environment Variable take effect. However, using this command is risky. Because I am here. /bash_profile adds a sentence "export PATH =/home/jx", and then runs source. after bash_profile, the basic commands in my bash shell, such as su, ls, cd, and vi, cannot be used. The command "-bash: ls: command not found" is displayed "!
Solution: I think a stupid method is to log on again, but log on with another user name, and then enter "su" in shell to enter root, modify the preceding description under root. bash_profile file. You are welcome to provide better solutions.
4: Test
The installation is successful. Otherwise, a message is displayed.
Bash: arm-linux-gcc: command not found
5: finishing work
Delete used files
Debian:/home/zt/tools/usr/local # cd ../..
Debian:/home/zt/tools # rm-rv usr
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.