为什么工具链名称有单独的 OS 和 EABI 字段。?

Why does toolchain name have separate OS and EABI fields.?

例如。手臂未知-linux-gnueabi 现在,一旦 OS 即 Linux 被修复,C 库将被修复 (GLibc),因此调用约定和所遵循的 ABI 将被修复。第 4 个字段(即 ABI)的要求是什么?工具链是否可以使用与底层 OS 和 LIBC 使用的 ABI 不同的 ABI。在这种情况下,上述工具链 运行 在 OS 上将如何编译库?

多多少少是历史原因,a.k.a the holy wars about the sacred operating system's name. What you call the "toolchain name" is actually called the Target Triplet,顾名思义,它有三个个字段,不多或更少。在您的示例中,字段为:

  • Machine/CPU: arm
  • 供应商:unknown
  • 操作系统:linux-gnueabi

再举一个我遇到过的参考例子:i686-elf-gcc,用于hobbyist operating system development:

  • Machine/CPU: i686-elf
  • 供应商:unknown(隐式)
  • 操作系统:none(隐式;编译器实际上是 freestanding cross compiler, used for the development of operating system kernels,因此它输出的代码不需要底层 OS,因为输出代码是 OS 本身!)。

这只是一个混淆问题,因为字段可能(确实)使用 - 字符,用于分隔字段, 也。在您的情况下,OS 被认为是 linux-gnueabi,也称为 GNU 操作系统,其 Linux 内核使用 Embedded ARM ABI. The Linux Kernel has historically been one of the most portable pieces of software in the world,因此它有望移植到其他 ARM ABI,虽然我只知道 EABI...