DS-5新加交叉编译工具

微笑、不失礼 提交于 2019-12-01 02:43:47

Adding New Compiler Toolchains to DS-5

In this tutorial, you will learn how to add new compiler toolchains (Arm Compiler 5, Arm Compiler 6 and GCC) to DS-5 and configure them for your project easily.

Introduction

From Arm DS-5 Development Studio v5.20, you can add new compiler toolchains (Arm Compiler 5, Arm Compiler 6 and GCC) and configure them for your project more easily. Different versions of the same toolchain will keep their flags when you switch between them and projects can be shared between you and your colleagues without re-configuring the path.

 

Note: If you are installing Arm Compiler 6 alongside DS-5 and you don't have a DS-5 Ultimate Edition license, you will need to set the following environment variable: ARM_TOOL_VARIANT=pro. This can be done using set ARM_TOOL_VARIANT=pro in DS-5 Command Prompt, or as a global environment variable in your OS.

DS-5 Settings

Open up DS-5 and click Window > Preferences followed by DS-5.

Select Toolchains, which will bring up the following dialog:

DS-5 includes three compiler toolchains: Arm Compiler 5, Arm Compiler 6 and GCC. These are listed as "built-in", showing that they're already installed.

Note: DS-5 lists the major version number of the compiler (i.e. Arm Compiler 5). This allows your projects to be portable between DS-5 versions when we update the included compilers. When you add a specific version, such as Arm Compiler 5.04u2, this will show up with the sub version.

Click Add...

If you have already downloaded a compiler toolchain, browse to the location of the toolchain bin directory.

Otherwise you can either:

    • Go to ds.arm.com and download the Arm Compiler 6 toolchain.

Or

In this case, I've downloaded and installed GCC 7.3.1.

Click Next > to run autodetection. In most cases, this should provide a full set of information about the toolchain. However, for custom implementations of GCC, you can manually edit these fields.

Click Finish to complete the process.

You should now see the new toolchain listed alongside the built-in toolchains:

You'll be prompted to restart Eclipse for these changes to apply. When you've done this, you will be able to see the new toolchain listed as an option when you start a new project:

Additionally, you can reconfigure existing projects to use the newly added toolchain by right-clicking on the project, selecting Properties > C/C++ Build > Tool Chain Editor and then choosing it in the Current toolchain dropdown:

Finally, you'll notice that if you swap between different versions of the same toolchain, DS-5 will now remember your flags and other settings, so there's no need to re-enter them. However, this is not the case when moving between different toolchains (such as Arm Compiler 5 and Arm Compiler 6).

It's also possible to add and/or select new toolchains using the DS-5 Command Prompt. You'll notice that on startup, the Command Prompt now contains a message explaining that no toolchain is set by default, along with the select_toolchain command to begin the process of selecting one.

To add a new toolchain, use the add_toolchain command followed by the path to the folder where the binary is located. For example add_toolchain "C:\Program Files (x86)\Linaro\gcc-linaro-aarch64-linux-gnu-4.9-2014.05\bin". Just like the GUI, you will then have the opportunity to finish the process, or manually edit the details:

Entering select_toolchain brings up a numbered list including the new toolchain:

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!