Ubuntu Install ARM-LINUX-GCC Cross-compile chain __linux

Source: Internet
Author: User

How are you doing. Here is the Kite blog, welcome to communicate with me.

If this blog is helpful to you, you may be able to comment below to leave a message for me.


Cross-compilation Chain download Address:
ftp://ftp.gnu.org/gnu/gcc
or download at arm's website:
Https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads

Taking the installation of arm-linux-gcc-4.3.2 as an example

ubuntu16.04 (64-bit system)


Because Ubuntu uses 64-bit, installing the GCC tool chain requires some 32-bit library support

If not, you will be prompted when Arm-linux-gcc-v:

/usr/local/arm/4.3.2/bin/arm-linux-gcc:15:
EXEC:/usr/local/arm/4.3.2/bin/.arm-none-linux-gnueabi-gcc:not found

Ubuntu Specific library can be its own under the Baidu
For example I am ubuntu16.04, is installed as follows two libraries
sudo apt-get install lib32ncurses5
sudo apt-get install lib32z1


Open Ubuntu Terminal command

sudo tar xjf arm-linux-gcc-4.3.2.tar.bz2-c/

Note: c is followed by a space, and C is uppercase, it is the English word "change" the first letter, here is the meaning of changing the table of contents. Execute this command, will install ARM-LINUX-GCC to/directory.

Unzip the tool chain, unzip to the root directory, as if the compression package was specified to understand the pressure path, which directly to the/usr/local/arm/directory to extract the

In fact, is also extracted to the/usr/local/arm/directory good
cd/usr/local/arm/4.3.2/bin/
Echo $PATH
This will appear:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/work/tools/gcc-3.4.5-glibc-2.3.6/bin
Above these are environment variables.

Then enter:
Export Path=/usr/local/arm/4.3.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
It's okay.

We can enter:

Arm-linux-gcc-v

To view the version, you find that the GCC version has been turned into version 4.3.2, but the reboot is invalid.


If you don't want to manually change each time, add an environment variable:

Method One: Modify the/ETC/BASH.BASHRC file (this file applies only to the current user)
sudo vi/etc/bash.bashrc
At the end add the export path= $PATH:/work/local/arm/4.3.2/bin (note that there are no spaces on the equals sign)


Method Two: Modify the/etc/profile file (this file is a system-level environment variable, set inside the thing for all users)
sudo vi/etc/profile
Add the path setting, adding the following at the end:
Export path= $PATH:/usr/local/arm/4.3.2/bin


Method Three: Modify the/etc/environment file

sudo vi/etc/environment

The original content should be
Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
The contents of the modification are:
Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/arm/4.3.2/bin"


Optional method, restart the virtual machine can


Arm-linux-gcc-v
You'll also find that the GCC version has been turned into version 4.3.2.

PS: It is best to install the Libstdc++ library:

sudo apt-get install lib32stdc++6

Otherwise, you may get an error at compile time:

While loading shared Libraries:libstdc++.so.6:cannot open Shared object file:no such file or directory


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.