根据对操作系统的支持与否,工具链可分为支持和不支持操作系统。
例如 arm-none-eabi,arm-none-linux-eabi。下面我们来详细讲解工具链的命名规则与工具链之间的联系。
1.1 arm-none-eabi
即 ARM architecture,no vendor,not target an operaTIng system,complies with the ARM EABI 是不支持操作系统的,自然无法使用那些跟操作系统关系密切的函数,比如 fork(2)
。该工具链使用的是 newlib
这个专用于嵌入式系统的 C
库。
主要用于编译 ARM 架构的裸机系统(包括 ARM Linux 的 boot,kernel,不适用编译 Linux 应用 ApplicaTIon),一般适合 ARM7,Cortex-M 和 Cortex-R 内核架构的芯片开发使用,所以不支持与操作系统关系密切的函数。
1.2 arm-none-linux-gnueabi-gcc
即 ARM architecture, no vendor, creates binaries that run on the Linux operaTIng system, and uses the GNU EABI
主要用于编译基于 ARM 架构的 Linux 系统,可用于编译 ARM 架构的 u-boot,Linux 内核,Linux 应用等。arm-none-linux-gnueabi 基于 GCC,使用 Glibc
库,经过 Codesourcery 公司优化过推出的编