Record the ubuntu cross-compilation tool chain installation

arm-linux-gnueabihf-gcc is an ARM cross-compilation tool launched by Linaro based on GCC. It can be used to cross-compile the code of all links in the ARM system, including bare metal programs, u-boot, Linux kernel, filesystem and App applications.

arm-linux-gneabihf-gcc is similar to CodeSourcery's arm-none-linux-gnueabi-gcc, and can be used to compile all links based on the ARM platform. CodeSourcery's cross-compilation tool was released earlier, from 2005 until now.

Linaro is a non-profit company jointly developed by ARM, Freescale, IBM, Samsung, ST-Ericsson, and TI to develop common software for system-on-chip (SoC) platforms of different semiconductor companies. Linaro was established in 2010 and issued in November of that year

Release the first version of ARM Cortex-A as the core SoC software tool for performance optimization.

  1. Download package

Download the pre-compiled binary package from Linaro's website at https://launchpad.net/linaro-toolchain-binaries/trunk/2013.10.

Pay attention to the selected version, we have to use the one under linux. Choose this:

gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.bz2

  1. Unzip

Unzip gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.xz to ~/arm-cross-toolchain/ directory

  1. Set environment variables

~ $ vi .bashrc

Add the following 2 lines at the end:

PATH=$PATH:/home/lxl/arm-cross-toolchain/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin

export PATH

Please note that the first line of $PATH is followed by an English colon, and after the colon is the absolute path of your cross-toolchain executable file directory (bin directory). The meaning of these two sentences is to add the executable file path of the cross-toolchain to the system environment variable PATH.

  1. Make environment variables take effect

~$ source .bashrc

  1. test

~$ arm-linux-gnueabihf-gcc -v
may appear when the Linux cross-compilation tool verifies the installation.
./arm-none-linux-gnueabi-gcc: There is no such file or directory.

解决方法是:
执行:sudo apt-get install lsb-core
LSB(Linux Standards Base)是一套核心标准,它保证了LINUX发行版同LINUX应用程序之间的良好结合
如果验证安装时出现下面错误:

报错:arm-linux-gnueabihf-gcc: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

原因:缺少32位库,由于ubuntu16.04我使用的是64位的
解决:sudo apt-get install lib32stdc++6*
另外在安装一条:sudo apt-get install lib32z1*

Reprinted from https://www.cnblogs.com/emlslxl/p/5582959.html
and supplements the problems encountered in the process

Guess you like

Origin blog.csdn.net/qq_33632004/article/details/88910215