Search code examples
armeabi

Compiler Implementation Dependency on ABI


As from this Question What is Application binary Interface, ABIs cover details such as

  • data type, size, and alignment;
  • the calling convention, which controls how functions' arguments are passed and return values retrieved;
  • the system call numbers and how an application should make system calls to the operating system;
  • Stack frames (activation records) [not in the above question]

My questions are,

  1. If ABIs define these rule then does the compiler that generates binaries for the target architecture depends on Architecture ABIs??? for example the compiler of ARM has to follow ARM eabi???
  2. Who design these ABIs??? the vendor, architecture designer (core), compiler designers???

Solution

  • A compiler is just a program like an image manipulation program. You have an input and an output, in both cases they have to conform to some standard (language, file format). But how you do it is up to you. For the compiler case you only need to make code that will work on the target platform which is defined by the instruction set, and for a sane compiler you choose or create a calling convention that works for the language, but it is up to you.