views:

78

answers:

1

Do WinCE and Linux use the same calling convention on ARM? What are the differences?

The documents I've found so far do not explain very well. For example on http://msdn.microsoft.com/en-us/library/ms864497.aspx, it says "Windows CE .NET Compiler" on one line, but "the ARM compiler" on the next line, and "CLARM" at the bottom, and it's not clear whether it is referring to the same compiler or different compilers. Here's what I've found so far...

The reason I ask is that I'd like to try using LLVM in WinCE to generate some simple code at run-time, but it only officially supports Linux.

+1  A: 

Calling conventions are something that are implemented by the compiler and are not operating system specific. Having said that I can confirm that both gcc and RVCT (ARM's c/c++ compiler) both generate code that follow the Procedure call convention for ARM architecture that you mentioned above.

Looking at the link to the Microsoft documentation, I can also confirm that it follows the ARM calling convention.

doron
If you want to be able to call OS-defined functions (and supply callbacks to those functions) then the calling convention is OS-specific. I would expect a compiler, by default, to use the calling convention expected by the OS, so that callback functions can be passed to it.... but you're right, the compiler could use something different. What about exception handling? It might require that all compilers follow certain conventions so that the stack can be unwound reliably.
Qwertie