Install the cross compiler arm-none-linux-gnueabi-gcc procedure

(It is recommended that all commands be performed under root)
That is, first enter su to obtain root privileges (if the password is prompted to change the password by Baidu),
then execute the following commands
1. Download, thanks to the almighty wget

wget http://www.codesourcery.com/sgpp/lite/arm/portal/package4571/public/arm-none-linux-gnueabi/arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

2 After the download is complete, use the following command to copy the file to the /usr/local folder and unzip it

cp arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 /usr/local

(If the prompt is wrong, use su as root to execute) and then execute the following command

cd /usr/local
tar -jxvf arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

3 Configure the environment variables to make them take effect

vi /etc/bash.bashrc

First, move the cursor to the last line of the file (use the up, down, left and right keys on the keyboard)

Next, press the o key on the keyboard to add a new line under the line where the cursor is located to start inserting;

Then, insert the following statement; (copy and paste it)

export PATH=$PATH:/usr/local/arm-2009q1/bin/

Finally, save and exit.
The exit method is: first press the ESC key to return to the command mode; then enter a colon: , to enter the last line mode.
Enter wq and press Enter to successfully save the /etc/bash.bashrc script and exit vi.

Final execution: source /etc/bash.bashrc
close the current terminal and reopen the terminal for testing
4. Test, enter

arm-none-linux-gnueabi-gcc -v

If: No such file or directory appears
this is because 64-bit Ubuntu is not compatible with 32-bit software. Enter the following command

su  注释:还是获取root权限 如果已经是root身份请忽略~
sudo apt-get install lib32z1 lib32ncurses5 libbz2-1.0:i386 lib32stdc++6  

re-enter

arm-none-linux-gnueabi-gcc -v

If you can output a long list of messy things and finally gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203), then it means that the installation is successful, and you can compile happily.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324732756&siteId=291194637