Le jeudi 20 septembre 2012 13:04:54, Mason a écrit : > Hello tcc devs, > > For a while, I've been looking for a way to write (and test) > small programs in C on an Android tablet. Recently, I found > an app (based on tcc) which allows exactly that, and I started > wondering how it is done. > > Android platforms are mostly based on ARM or MIPS CPUs (though > Intel has now ported Android to x86). I don't think tcc has ARM > and MIPS code generators, right? So I assume that the C code is > not actually compiled into machine code, but instead interpreted > "on the fly" using tcc's script mode. Would that seem like a > reasonable guess?
Tinycc does support arm CPUs. Right now it support 2 calling convention : the old ABIS and the base EABI calling convention. It should also support soon(ish) the standard variant EABI calling convention. To be more precise, it already supports this calling convention but there is some relocation missing for the linkage to work. I'm actually working on it though, and I hope to provide a patch in 1-2 weeks if everything goes well. Since android uses the base EABI calling convention, it should work fully on android/ARM. > > On to the app itself. Since it runs on Android, then either tcc > has been ported to Java so it can run on any Android system as > byte code, OR it has been compiled as a C++ app using the native > SDK (but then there would have to be one for ARM and one for MIPS). > Which is more likely? And did I miss other possibilities? I doubt it was ported to java so it's most probably compiled natively. By the way, it seems you are confused between the HOST architecture (the architecture tcc runs on) and the target architecture (the architecture for which tcc generates code). For instance, although tcc doesn't support MIPS, it can run on MIPS and create program for x86, x86-64 and arm. Best regards, Thomas Preud'homme
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
