GNU软件用target triplet来描述工作平台,target triplet是一种规范化的名称,形如cpu-vendor-os(where os can be ‘system’ or ‘kernel-system’)同时FSF希望GNU/Linux的配置名称同时包含linux和gnu。很多程序的源码包里都有的 config.guess 脚本用于确定target triplet,大多数情况下pc平台的target triplet是i686-pc-linux-gnu。

来看看工具链:

EABI/ELF用于RTOS和裸机bare metal systems的arm-none-eabi 中间的none其实是vendor;

GNU/Linux 用于Linux kernel和applications的arm-none-linux-gnueabi 其实是arm-none-linux-gnu-eabi的缩写,由于一些工具要求配置名称最多有三个连字符,所以gnu和eabi合写在一起。

The ABI for the ARM Architecture is a standard developed by ARM and its partners that explains how compilers, assemblers, linkers, and other similar tools should generate object files and executable files.

Tools that correctly implement the ABI for the ARM Architecture can interoperate; i.e., object files built with one toolchain can be combined with object files built with another toolchain if both compilers use the ABI for the ARM Architecture and provided that the code compiled observes certain conventions.

CodeSourcery was an active participant in the design of the ABI for the ARM Architecture. (In fact, the C++ ABI used by ARM is derived from the Itanium C++ ABI co-designed by CodeSourcery.) CodeSourcery continues to work with ARM, Ltd. to validate interoperability between Sourcery G++ and ARM's proprietary tools.

The "ARM EABI" is an informal name for the ABI for the ARM Architecture.

api 是应用程序和操作系统之间的接口,凡是符合该api标准的应用程序都可以在支持该api的操作系统上编译通过。

abi 是二进制级别的接口,规定了二进制文件的格式、内容、装载/卸载程序的要求、函数调用时的参数传递

规则、寄存器、堆栈的使用。
如果操作系统都支持该api,但是机器的体系结构不同即他们的abi不同,那么在一个机器上生成的二进制代码是不可以在另外一台机器上面运行成功的,可能因为函数调用的参数传递规则不同或者其他由abi定义的行为产生的差异性。
其实关键的是abi定义了运行时的兼容性问题,这个问题是api无法解决的。api所能解决的是静态状态下的兼容性问题。

以下摘自encyclopedia of PCMAGZINE

Definition of: API
(Application Programming Interface)
A language and message format used by an application program to
communicate with the operating system or some other control program such
as a database management system (DBMS)
or communications protocol. APIs are implemented by writing function
calls in the program, which provide the linkage to the required
subroutine for execution. Thus, an API implies that some program module
is available in the computer to perform the operation
or that it must be linked into the existing program to perform the
tasks.

Definition of ABI

(Application Binary Interface)
A specification for a specific hardware platform combined with the
operating system. It is one step beyond the application program
interface (API), which defines the calls
from the application to the operating system. The ABI defines the API
plus the machine language for a particular CPU family. An API does not
ensure runtime compatibility, but an ABI does, because it defines the
machine language, or runtime, format.

05-17 08:01