With its production and installation crosstool cross compiler

installation

1. Using the command:
git clone git: //crosstool-ng.org/crosstool-ng
because ubuntu is not installed by default on top of git tools need to be installed in advance, the command:
sudo APT-GET install git

2. After the download is complete, extract the user directory, go to crosstool-ng-1.20.0 directory.
Here Insert Picture Description
Bootstrap file 3. Execute the file, you will be prompted to install unnecessary compilation.

Here Insert Picture Description

Using sudo apt-get install autoconf
performed after installation ./configure

4. Run make, then execute sudo make install
test 5. After installation ct-ng, appears Here Insert Picture Description
the installation was successful.

Making cross-compiler

1.ct-ng list-samples view crosstoll-ng tool support tool module produced which, as shown below: Here Insert Picture Description
Pick arm-unknown-linux-gnueabi, by performing ct-ng arm-unknown-linux -gnueabi generates a corresponding command config file.

2. Use: ct-ng menuconfig command to enter configuration page

Here Insert Picture Description
(1) Path Configuration
Here Insert Picture Description
1 Local tarballs directory: Specifies the compiler needs to make the source code package download store, can be modified at any location, built in advance and pay attention to rights.
2 Prefix directory: making good cross compiler directory is placed.

(2) Platform Configuration

Here Insert Picture Description
1.Target Architecture:这个选择arm架构;
2. Architecture level:指CPU指令集架构,
3. mit assembly for CPU:cpu核心,如Contex-A7
4.Tune for CPU:哪一款CPU。
5.Use specific FPU:FPU处理器,VFP或neon等。
6.Floating point:浮点运算类型,软浮点或硬浮点

(3)工具链配置
Here Insert Picture Description
1.Tuple’s vendor string:供应商字符串,若设置为abc,则编译后的工具链名字为arm-abc-linux-gnueabi。
2.Tuple’s alias:工具链的别名,若设置为arm-linux,则编译后会建立工具链的软连接,命名为arm-linux-xx。

(4)其他配置根据需要进行调整。
1.jOperating System —>菜单。选择编译的内核版本。这里使用默认的参数;
2.Binary utilities —>选择binutils的源码包版本号,配置二进制工具。这里使用默认参数。
C-library —>菜单,选择glibc库版本,使用默认参数
C compiler —>菜单选择GCC版本,选择默认参数
Debug facilities —>菜单,选择调试工具版本,默认参数。

编译

Ct-ng build command
at this time, errors may occur, as
Here Insert Picture Description
this is because ubuntu is not installed g ++ gcc, g ++ only need to install here you can:
sudo APT-GET install g ++.

After compiling complete directory of all the tools in the (previously set their own path in the configuration). Next, set the environment variable
export PATH = $ PATH: / work / tools /
In order to prevent each reboot the system should be set in sudo vi / etc / environment PATH to modify the value of
PATH = "/ usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / sbin: / bin: / usr / games: / usr / local / games: / Work / Tools / crosstool / bin "
. then run the / etc / environment enter into force environment variables

YJN
Released four original articles · won praise 0 · Views 18

Guess you like

Origin blog.csdn.net/qq_41812260/article/details/103037269