tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Using tcc for C development on Android tablet


From: Thomas Preud'homme
Subject: Re: [Tinycc-devel] Using tcc for C development on Android tablet
Date: Thu, 20 Sep 2012 14:57:55 +0200
User-agent: KMail/1.13.7 (Linux/3.2.0-3-amd64; KDE/4.8.4; x86_64; ; )

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

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]