I can only answer the 2nd question.
Does the calling convention used by Windows RT on ARM differ from that used by other (embedded) ARM Windows variants?
There are actually three concept that should be understood. One is the ARM Procedure Call Standard, another is the Language ABI and a third is the system call convention. Briefly, the ARM Procedure Call Standard describes register use in a prologue/epilogue. The Language ABI describe how language variables are passed. Ie, a double, a long long, the this pointer, dynamic_cast<>
, etc. The first is needed to interface assembler with the compiler, the 2nd is needed for compiler interoperability. The 3rd is how OS calls are made.
ARM Procedure Call Standard
The apcs.txt document helps to understand some of the ARM variants. There are 16 variants based on four different choices.
- 32 bit vs 26 bit PC - all post 2000 version will use 32 bit.
- stack limit checking - possibly re-phrased as MMU or no MMU.
- floating point - supported on most CPU after approximately 2005.
- Re-entrant vs non-re-entrant - a pure software choice; shared libraries?
So while there are sixteen theoretical variations, for modern systems using an MMU there are only two. The Debian ARM hard float wiki gives information that some Linux/gcc distributions have under went. I would guess that Window RT is using hard float as they would not want to pay a performance price to support outdated hardware. Finally, it is hard to think that shared library or DLL support wouldn't be present in Window RT. So the ARM Procedure Call Standard seems to be identical to a Linux hard float ABI.
'C/C++' ABI
The AAPCS defines how languages are meant to map high level function/methods to low level details. Name mangling ensures that symbols has canonical names so that cross tool linking is possible. AAPCS tools should theoretically inter-operate, but issues may appear with support libraries and other system level interfaces.
OABI/EABI
The Embedded ARM wiki gives some information on this standard. An OS using an MMU will use some calls to transition from user mode to system mode. Generally, these are library only features and are not part of the compiler. However, you can certainly find some ARM systems that use the OABI convention. As Microsoft is late the ARM game, they will either use the EABI or invented something new. For instance, calling malloc()
with a gcc linux hard-float compiler will not work as the system calls will be completely different. Generally you will have to compile with -nostdlib
and invent your own C-library.
I have googled a little bit to find specifics on Visual C++.
So to answer your 2nd question, there are a lot of compilers/systems that will generate similar prologue/epilogue. If the Visual C++ uses the AAPCS, then it can inter-operate with other AAPCS compilers. You may have to create custom libraries to get another compiler to call Windows RT system calls. The other questions should be answered in a manual.
Edit: GCC's ARM -mabi selects the ABI. aapcs-linux is AAPCS/EABI, apcs-gnu is the OABI defining prologue/epilogue and argument mappings. Compiler configuration select the target OS and instruction/back-end/CPU type; so we have compilers with different names, like arm-linux-eabi-gcc
, arm-linux-gnueabi-gcc`, etc.