Calling Convention

1

Why ABI, Calling Conventions, and Cross-Compilation Can Produce Binaries That Build but Do Not Run

8 minute

Cross-compilation creates an easy illusion: if the program built successfully, it should run on the board.

In practice, that often fails. The executable is copied to the device and reports Exec format error. The file exists, but execution says not found. Linking succeeds, but the program crashes when calling a library function. Both targets are ARM, but changing toolchains breaks floating-point arguments. Both targets are RISC-V, but the generated program uses instructions the board does not support.

Read More